| time_calendar | R Documentation |
This S7 generic function extracts the calendar system from a time object. The calendar defines the collection of time units (years, months, days, etc.) used to interpret the time representation.
time_calendar(x, ...)
x |
A time object (e.g., base::Date, base::POSIXct, |
... |
Additional arguments for methods. |
A calendar object (e.g., cal_gregorian, cal_isoweek)
# The calendar of a Date object is the Gregorian calendar
time_calendar(Sys.Date())
# The calendar of a POSIXct object is also Gregorian
time_calendar(Sys.time())
# The calendar of a yearweek object is the ISO week calendar
time_calendar(yearweek(Sys.Date()))
# A mixed time object returns a list of calendars
time_calendar(c(yearmonth(Sys.Date()), Sys.Date()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.