| chronon_divmod | R Documentation |
This function converts between chronons measured in different time granules.
It is used internally for converting between different continuous time types,
and is particularly useful for efficiently converting between irregular time
granules. The default method uses chronon_cardinality() to cast between
time granules, which is efficient for regular time granules.
chronon_divmod(from, to, ...)
from |
The time granule that |
to |
The time granule to convert |
... |
Additional arguments for methods. |
An list of two elements:
div: integer vector of chronons measured in the to time granule.
mod: integer vector of the remainder (in from time granule) after
converting to the to time granule.
# Convert day 16 after epoch (1970-01-01) into weeks since epoch (and remainder days)
with(cal_isoweek, chronon_divmod(day(1L), week(1L), 16L))
# Convert week 4 after epoch (1970-W1) into days since epoch
with(cal_isoweek, chronon_divmod(week(1L), day(1L), 4L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.