# NOT RUN {
# path to the cropped and cutted MODIS images for the region of Navarre
wdir <- system.file("ExNavarreVar", package = "RGISTools")
# list all the tif files
files.mod <- list.files(wdir, pattern="\\.tif$", recursive = TRUE, full.names = TRUE)
# print the MOD09 bands
getRGISToolsOpt("MOD09BANDS")
# select the SWIR1 and SWIR2 bands
img.mod.swir1 <- raster(files.mod[6])
img.mod.swir2 <- raster(files.mod[7])
# calculate the NBR2 image
img.mod.nbr2 <- varNBR2(img.mod.swir1,img.mod.swir2)
# plot the image
spplot(img.mod.nbr2,col.regions=rev(heat.colors(20)))
# }
Run the code above in your browser using DataLab