Learn R Programming

MODIS (version 1.0.0)

aggInterval: Create (Half-)Monthly Composite Periods

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 composite periods from a user-defined temporal range.

Usage

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

Arguments

x

numeric year or Date object.

interval

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

Value

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).

See Also

transDate.

Examples

Run this code
dates <- c(2015, 2016)

aggInterval(dates)
aggInterval(dates, interval = "fortnight")

Run the code above in your browser using DataLab