This S7 generic function extracts the cycle (the cyclical time unit) from a time object, such as cyclical time representations.
Arguments
- x
A time object (e.g., base::Date, base::POSIXct,
linear_time(), etc.)- ...
Additional arguments for methods.
Examples
# Non-cyclical objects return NULL
time_cycle(Sys.Date())
#> NULL
# The cycle of a cyclical time object
time_cycle(month_of_year(Sys.Date()))
#> <mixtime::tu_year> int 1
#> @ tz: chr "UTC"