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.
Value
An list of two elements:
chronon: integer vector of chronons measured in thetotime unit.remainder: integer vector of the remainder (infromtime unit) after converting to thetotime unit.
Examples
# Convert day 16 since epoch into weeks since epoch (and remainder days)
chronon_divmod(tu_day(1L), tu_week(1L), 16L)
#> $chronon
#> [1] 2
#>
#> $remainder
#> [1] 5
#>
# Convert week 4 since epoch into days since epoch
chronon_divmod(tu_week(1L), tu_day(1L), 4L)
#> $chronon
#> [1] 32
#>
#> $remainder
#> [1] 0
#>