time_add {timeplyr} | R Documentation |
Add/subtract timespans to dates and date-times
Description
A very fast method of adding time units to dates and date-times.
Usage
time_add(
x,
timespan,
roll_month = getOption("timeplyr.roll_month", "xlast"),
roll_dst = getOption("timeplyr.roll_dst", c("NA", "xfirst"))
)
time_subtract(
x,
timespan,
roll_month = getOption("timeplyr.roll_month", "xlast"),
roll_dst = getOption("timeplyr.roll_dst", c("NA", "xfirst"))
)
time_floor(x, timespan, week_start = getOption("lubridate.week.start", 1))
time_ceiling(
x,
timespan,
week_start = getOption("lubridate.week.start", 1),
change_on_boundary = is_date(x)
)
Arguments
x |
Time vector. |
timespan |
|
roll_month |
See |
roll_dst |
See |
week_start |
day on which week starts following ISO conventions - 1
means Monday, 7 means Sunday (default). When |
change_on_boundary |
|
Details
The methods are continuously being improved over time. Date arithmetic should be very fast regardless of the timespan supplied. Date-time arithmetic, specifically when supplied days, weeks, months and years, is being improved.
Value
A date, date-time, or other time-based vector.