date_month_factor | R Documentation |
date_month_factor()
extracts the month values from a date or date-time and
converts them to an ordered factor of month names. This can be useful in
combination with ggplot2, or for modeling.
date_month_factor(x, ..., labels = "en", abbreviate = FALSE)
x |
A date or date-time 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 <- add_months(as.Date("2019-01-01"), 0:11)
date_month_factor(x)
date_month_factor(x, abbreviate = TRUE)
date_month_factor(x, labels = "fr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.