I am running a project that requires reading .tif files as rasters. However, when I try to load the files in now, I get th error:
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", : Cannot create a RasterLayer object from this file. In addition: Warning message: 'file location/name.tif' not recognized as a supported file format. (GDAL error 4)
I'm using the function raster("file location/name.tif")
and it has been working until recently.
I am currently working with the raster
package along with sp
and rgdal
. I've updated each of the packages and still get this error. I've also tried installing and using the terra package but get the same error with that as well.
I'm not sure what to do at this point since I'm pretty sure it isn't an issue with the code I'm running because I haven't changed anything since the last time it worked.