aggInterval: Create Periods for Temporal Composites

Description Usage Arguments Value Author(s) See Also Examples

View source: R/aggInterval.R

Description

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.

Usage

1
aggInterval(x, interval = c("month", "year", "fortnight"))

Arguments

x

Date object, see eg default value of 'timeInfo' in temporalComposite.

interval

character. Time period for aggregation. Currently available options are "month" (default), "year" and "fortnight" (i.e., every 1st and 15th day of the month).

Value

A list with the following slots:

Author(s)

Florian Detsch

See Also

transDate.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

MODIS documentation built on Nov. 12, 2020, 5:06 p.m.