I am loading the bands of Landsat8 to plot my vegetation indices but getting this error -
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
Cannot create a RasterLayer object from this file. (file does not exist)
In addition: Warning message:
LC08_L1TP_205021_20190628_20200827_02_T1_B2: No such file or directory (GDAL error 4)
I have checked to be sure the downloaded images are in my working directory as set on the worksheet.
Clearly, the file does not exist in your working directory. At least you are not providing any evidence to the contrary.
What you could do with the filename you want to use is
If that returns
FALSEthe file is not there.It is strange that your filename does not have an extension. It should probably be
A good way to get filenames can be