# NOT RUN {
# load a spatial polygon object of Navarre
data(ex.navarre)
mList <- modSearch(product = "MYD13A2",
startDate = as.Date("01-01-2011", "%d-%m-%Y"),
endDate = as.Date("31-12-2013", "%d-%m-%Y"),
collection = 6,
extent = ex.navarre)
head(mList)
# download the first image in mList
src <- paste0(tempdir(),"/Path_for_downloading_folder")
print(src)
src.mod <- file.path(src,"Modis","MYD13A2")
src.mod.hdf <- file.path(src.mod,"hdf")
modDownSearch(mList[1],
username = "user",
password = "pass",
AppRoot = src.mod.hdf)
# download all images in mList
modDownSearch(mList,
username = "user",
password = "pass",
AppRoot = src.mod.hdf)
# }
Run the code above in your browser using DataLab