aggInterval | R Documentation |
The creation of custom temporal aggregation levels (e.g., half-monthly,
monthly) from native 16-day MODIS composites usually requires the definition
of date sequences based on which the "composite_day_of_the_year" SDS is
further processed. Complementing transDate()
, which returns the respective
start and end date only, this function creates full-year (half-)monthly or
annual composite periods from a user-defined temporal range.
aggInterval(x, interval = c("month", "year", "fortnight"))
x |
|
interval |
|
A list
with the following slots:
$begin
: The start date(s) of each (half-)monthly timestep as
Date
object.
$end
: Same for end date(s).
$beginDOY
: Similar to $begin
, but with character
objects in
MODIS-style date format (i.e., "%Y%j"
; see strptime()
).
$endDOY
: Same for end date(s).
Florian Detsch
transDate()
.
dates <- do.call("c", lapply(2015:2016, function(i) { start <- as.Date(paste0(i, "-01-01")) end <- as.Date(paste0(i, "-12-31")) seq(start, end, 16) })) intervals <- c("month", "year", "fortnight") lst <- lapply(intervals, function(i) { aggInterval(dates, interval = i) }); names(lst) <- intervals print(lst)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.