aggregate_days: Aggregate dates in intervals

Description Usage Arguments Value Examples

View source: R/aggregate_days.R

Description

For each month all days inside the interval will be aggregated, e.g. for an interval length of five 1st January till 5th January will all belong to the first interval, 6th to 10th January will belong to interval 2 and so on. Note that the last interval has a varying number of days, e.g. 26th July to 31th July, but only 26th April to 30th April.

Usage

1
aggregate_days(.date, .interval = 5L)

Arguments

.date

(vector of class Date) Dates to be aggregated.

.interval

(integer value) The length of the interval (currently 5, 10, 15 supported).

Value

integer vector. For pentades a number between 1 and 72, e.g. "2016-02-16" will be 10.

Examples

1
2
3
aggregate_days(c("2017-02-16"), .interval = 10) # 5
aggregate_days(c("2016-01-31")) # 6
aggregate_days(c(NA, "2014-07-28")) # 42

markusdumke/lepidisthelper documentation built on Oct. 21, 2019, 3:54 a.m.