# NOT RUN {
# Using local sources
data("modis", package = "climatrends")
day <- as.Date("2013-10-28", format = "%Y-%m-%d")
temperature(modis,
day.one = day,
span = 12)
# }
# NOT RUN {
# Using NASA POWER
library("nasapower")
# random points within bbox(11, 12, 55, 58)
set.seed(123)
lonlat <- data.frame(lon = runif(3, 11, 12),
lat = runif(3, 55, 58))
# random dates within 2018-05-15 and 2018-05-2
set.seed(321)
dates <- as.integer(runif(3, 17666, 17670))
dates <- as.Date(dates, origin = "1970-01-01")
# get temperature indices for 40 days after day.one
temperature(lonlat,
day.one = dates,
span = 40)
# get temperature indices over a time series
temperature(lonlat,
day.one = dates,
span = 40,
timeseries = TRUE,
intervals = 5)
# }
Run the code above in your browser using DataLab