| granularity_names | R Documentation |
granularities() will return a character vector of canonical granularity names for the
relevant calendar. These are the granularities used to define dates on the calendar.
granularity() will return a vector of numerical values for a given canonical granularity.
granularity_names(calendar)
granularity(date, granularity)
calendar |
An object defining a calendar, of "calendar" class. |
date |
A date vector on some calendar |
granularity |
A character string indicating the granularity to extract |
A character vector of granularity names or a vector of numerical values for the specified granularity.
week_of_year for some non-canonical granularities.
granularity_names(cal_iso)
granularity_names(cal_gregorian)
date_iso <- new_date(year = 2025, week = 23, day = 2, calendar = cal_iso)
granularity(date_iso, "week")
date_gregorian <- new_date(year = 2025, month = 1, day = 1, calendar = cal_gregorian)
granularity(date_gregorian, "month")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.