calendar_month_factor | R Documentation |
calendar_month_factor()
extracts the month values from a calendar and
converts them to an ordered factor of month names. This can be useful in
combination with ggplot2, or for modeling.
This function is only relevant for calendar types that use a month field,
i.e. year_month_day()
and year_month_weekday()
. The calendar type must
have at least month precision.
calendar_month_factor(x, ..., labels = "en", abbreviate = FALSE)
x |
A calendar vector. |
... |
These dots are for future extensions and must be empty. |
labels |
Character representations of localized weekday names, month names, and
AM/PM names. Either the language code as string (passed on to
|
abbreviate |
If If |
An ordered factor representing the months.
x <- year_month_day(2019, 1:12)
calendar_month_factor(x)
calendar_month_factor(x, abbreviate = TRUE)
calendar_month_factor(x, labels = "fr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.