# NOT RUN {
# Using local sources
data("modis", package = "climatrends")
day <- as.Date("2013-10-28", format = "%Y-%m-%d")
GDD(modis,
day.one = day,
degree.days = 100,
base = 5,
span = 13)
# }
# NOT RUN {
# Using NASA POWER
library("nasapower")
set.seed(123)
# random geographic locations around bbox(11, 12, 55, 58)
lonlat <- data.frame(lon = runif(3, 11, 12),
lat = runif(3, 55, 58))
set.seed(321)
# random dates around 2018-05-15 and 2018-05-20
dates <- as.integer(runif(3, 17666, 17670))
dates <- as.Date(dates, origin = "1970-01-01")
# Calculate the days required for the plants in these plots to reach the
# maturity. Here the plant species requires ~1300 degree days for it.
GDD(lonlat,
day.one = dates,
degree.days = 1300,
base = 5)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab