# NOT RUN {
library(raster)
library(RCurl)
# download Vegetation Health Index for two months
vhi <- VHPdownload(x='VHI',dates=c('2015.01.01','2015.02.28'),rts=TRUE) # output is as rts object
vhi
plot(vhi[[1]])
plot(vhi[2120000]) # plot time series at the specified cell number
# to make sure the dates are appropriately specified, use a Date object:
dates <- as.Date(c('2015.01.01','2016.12.31'),format="<!-- %Y.%m.%d") -->
dates
class(dates)
dates <- as.Date(c('2012-01-01','2012-12-31'),format="<!-- %Y-%m-%d") -->
dates
# If your machine has multiple cores, you can use parallel downloading to speed up the downloads
# Vegetation Condition Index for two years
vci <- VHPdownload(x='VCI',dates=dates,rts=TRUE,ncore=4)
vci
plot(vci[[1:2]])
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab