# NOT RUN {
# load a spatial polygon object of Navarre
data(ex.navarre)
src <- paste0(tempdir(),"/Path_for_downloading_folder")
print(src)
modDownload(product = "MOD09GA",
startDate = as.Date("01-01-2018", "%d-%m-%Y"),
endDate = as.Date("03-01-2018", "%d-%m-%Y"),
username = "username",
password = "password",
AppRoot = src,
extract.tif = TRUE,
collection = 6,
extent = ex.navarre)
tif.src <- file.path(src,"Modis","MOD09GA","tif")
files <- list.files(tif.src,
pattern = "\\.tif$",
full.names = TRUE,
recursive = TRUE)[c(16,19,18)]
files.stack <- stack(files)
qrange <- c(0.001, 0.999)
imagen <- varRGB(files.stack[[1]],
files.stack[[2]],
files.stack[[3]],
qrange)
plotRGB(imagen)
# }
Run the code above in your browser using DataLab