Closed
Description
I created a raster stack (landsat_data) with 6 layers, each of which represents one band.I also saved the names of the layers in a vector (names_landsat). Now I want to calculate the spectral indices with the following code:
ind <- landsat_data
ind <- spectralIndices(ind,blue=as.character(names_landsat[1]),green=as.character(names_landsat[2]),red=as.character(names_landsat[3]),nir=as.character(names_landsat[4]),swir1=as.character(names_landsat[5]),swir2=as.character(names_landsat[6]))
Unfortunately R returns the following error message:
Error in if ((maxValue(img[[red]])/scaleFactor > 1.5 | minValue(img[[red]])/scaleFactor < :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In .local(x, ...) : max value not known, use setMinMax
2: In .local(x, ...) : min value not known, use setMinMax
I have absolutely zero clue what that means as I am pretty new to this package.
I would be very grateful if somebody could give me any kind of help.
Thanks.
Metadata
Assignees
Labels
No labels
Activity