Guest User

Untitled

a guest
Mar 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. library(raster)
  2. library(rgdal)
  3. NDVI< list.files("C:\Users\path\Desktop\PET\sample\", pattern="*.tif", all.files=F, full.names = FALSE, recursive = TRUE, ignore.case = FALSE)
  4. for (i in 1:length(NDVI))
  5. NDVI <- raster(function(x,y)
  6. (x="NIR"+str(i)+".tif"), (y="red"+str(i)+".tif"), (x-y/x+y)
  7. writeRaster(NDVI,"NDVI", format="GTiff")
Add Comment
Please, Sign In to add comment