This S7 generic function extracts the chronon (the smallest time unit) from a time object, such as continuous time or cyclical time representations.
Arguments
- x
A time object (e.g., base::Date, base::POSIXct,
linear_time(), etc.)- ...
Additional arguments for methods.
Examples
# The chronon of a Date object is 1 day
time_chronon(Sys.Date())
#> <mixtime::tu_day> int 1
# The chronon of a POSIXct object is 1 second
time_chronon(Sys.time())
#> <mixtime::tu_second> int 1
# The chronon of a continuous time year and month is 1 month
time_chronon(yearmonth(Sys.Date()))
#> <mixtime::tu_month> int 1
# The common chronon of a mixed time object is the finest chronon
time_chronon(c(yearmonth(Sys.Date()), Sys.Date()))
#> Error in mixtime_valid.default(X[[i]], ...): object 'v' not found