This function converts between chronons measured in different time units. It
is used internally for converting between different continuous time types,
and is particularly useful for efficiently converting between irregular time
units. The default method uses chronon_cardinality()
to cast between time
units, which is efficient for regular time units.
chronon_divmod(from, to, ...)
An list of two elements:
chronon
: integer vector of chronons measured in the to
time unit.
remainder
: integer vector of the remainder (in from
time unit) after
converting to the to
time unit.
# Convert day 16 since epoch into weeks since epoch (and remainder days)
chronon_divmod(tu_day(1L), tu_week(1L), 16L)
#> Error in chronon_divmod(tu_day(1L), tu_week(1L), 16L): could not find function "chronon_divmod"
# Convert week 4 since epoch into days since epoch
chronon_divmod(tu_week(1L), tu_day(1L), 4L)
#> Error in chronon_divmod(tu_week(1L), tu_day(1L), 4L): could not find function "chronon_divmod"