To aggregated data into n-day (e.g. 8-day, 16-day) like MODIS product, a n-day flag is need.

add_dn(d, days = 8)

Arguments

d

data.frame or data.table

days

Integer number or vector, can't have duplicated value.

Examples

date = seq.Date(as.Date("2010-01-01"), as.Date("2010-12-31"), by = "day")
d <- data.frame(date)
dnew <- add_dn(d, days = c(8, 16))