Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(raster)
- library(rgdal)
- NDVI< list.files("C:\Users\path\Desktop\PET\sample\", pattern="*.tif", all.files=F, full.names = FALSE, recursive = TRUE, ignore.case = FALSE)
- for (i in 1:length(NDVI))
- NDVI <- raster(function(x,y)
- (x="NIR"+str(i)+".tif"), (y="red"+str(i)+".tif"), (x-y/x+y)
- writeRaster(NDVI,"NDVI", format="GTiff")
Add Comment
Please, Sign In to add comment