- data
A tibble
with a date or datetime index.
- target
A column to apply the function to
- period
A time-based definition (e.g. "2 weeks").
or a numeric number of observations per frequency (e.g. 10).
See tibbletime::collapse_by()
for period notation.
- .fun
A function to apply (e.g. median
)
- ...
Additional parameters passed to the function, .fun
- start_date
Optional argument used to
specify the start date for the
first group. The default is to start at the closest period boundary
below the minimum date in the supplied index.
- side
Whether to return the date at the beginning or the end of
the new period. By default, the "end" of the period.
Use "start" to change to the start of the period.
- clean
Whether or not to round the collapsed index up / down to the next
period boundary. The decision to round up / down is controlled by the side
argument.
- message
A boolean. If message = TRUE
, the frequency used is output
along with the units in the scale of the data.