# NOT RUN {
require(raster)
data(tab)
temp <-list()
# we create 4 simulated rasters for the data included in the object tab:
for(i in 1:4) {
temp[[i]] <- runif(19800, 0, 254)
temp[[i]] <- matrix(temp[[i]], 180, 110)
temp[[i]] <- raster(temp[[i]], crs="+proj=utm")
extent(temp[[i]])<-c(3770000, 3950000, 6810000, 6920000)
}
writeRaster(temp[[1]], "20040719b4.tif", overwrite=T)
writeRaster(temp[[2]], "20040719b3.tif", overwrite=T)
writeRaster(temp[[3]], "20091106b4.tif", overwrite=T)
writeRaster(temp[[4]], "20091106b3.tif", overwrite=T)
# Computing NDVI images:
eco.NDVI(tab, "COST", "NDVI", "LT5")
example <- raster("NDVICOST20040719.tif")
image(example)
file.remove(c("NDVICOST20040719.tif", "NDVICOST20091106.tif",
"20040719b4.tif", "20040719b3.tif", "20091106b4.tif",
"20091106b3.tif")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab