Util to collapse the TIMESTAMP using lubridate::*_date functions
Usage
.collapse_timestamp(timestamp, ..., period, side = "start")
Arguments
Value
A vector of the same length as TIMESTAMP, with the collapsed timestamp
with the same tz as the original one.
Period
Periods accepted are in the "number period" format, as in
floor_date or a custom function name without quotes:
hours (exs. "1 hour", "12 hours")
days (exs. "1 day", "3 days")
weeks (exs. "1 week", "4 weeks")
months (exs. "1 month", "6 months")
years (exs. "1 year", "7 years")
Also a custom function can be supplied, one that transforms the
TIMESTAMP variable to the collapsed timestamp desired. See
sfn_metrics for details
Side
Side indicates if using floor_date (side = "start) or
ceiling_date (side = 'end'). Ceiling dates is not
trivial, see ceiling_date for information on how
the date will be ceiled.