| duration | R Documentation |
duration() creates a vector of durations with a specified chronon.
Durations represent a fixed span of time measured in a given time granule
(e.g., 3 months, 5 days), without reference to a specific point in time.
duration(
data,
chronon = time_chronon(data),
discrete = NULL,
calendar = time_calendar(data)
)
data |
A time vector of duration magnitudes, or an existing
|
chronon |
A time granule expression representing the chronon, evaluated
in the context of |
discrete |
Logical. If |
calendar |
Calendar system used to evaluate |
A mixtime vector containing an mt_duration vector.
new_duration_fn() for creating reusable duration functions
cal_gregorian, cal_isoweek for calendar systems
# A duration of 3 months
duration(3L, cal_gregorian$month(1L))
# A vector of durations in days
duration(1:7, cal_gregorian$day(1L))
# Convert a duration of 4 days into weeks
duration(days(4), cal_isoweek$week(1L), discrete = FALSE)
duration(days(4), cal_isoweek$week(1L), discrete = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.