| new_linear_time_fn | R Documentation |
new_linear_time_fn() creates a linear time function for a specified
chronon. A chronon is the smallest indivisible time granule (e.g., days,
hours).
new_linear_time_fn(chronon, default_calendar = cal_gregorian)
chronon |
A bare call for a time granule object representing the chronon
(e.g., |
default_calendar |
A default calendar used to find the time units for
conversion if they don't exist in the calendar of the input data (e.g.,
|
A function used to create linear time points with a specific chronon.
# Linear time with 1 month granules as the chronon
ym <- new_linear_time_fn(month(1L))
ym(Sys.Date())
# Linear time with 1 day granules as the chronon
yd <- new_linear_time_fn(day(1L))
yd(Sys.Date())
# Linear time with 1 week granules as the chronon, using the ISO week calendar
yw <- new_linear_time_fn(week(1L), default_calendar = cal_isoweek)
yw(Sys.Date())
# Linear time with 1 hour granules as the chronon
ymd_h <- new_linear_time_fn(hour(1L))
ymd_h(Sys.time())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.