weekday_factor | R Documentation |
weekday_factor()
converts a weekday object to an ordered factor. This
can be useful in combination with ggplot2, or for modeling.
weekday_factor(x, ..., labels = "en", abbreviate = TRUE, encoding = "western")
x |
A weekday 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 |
encoding |
One of:
|
An ordered factor representing the weekdays.
x <- weekday(1:7)
# Default to Sunday -> Saturday
weekday_factor(x)
# ISO encoding is Monday -> Sunday
weekday_factor(x, encoding = "iso")
# With full names
weekday_factor(x, abbreviate = FALSE)
# Or a different language
weekday_factor(x, labels = "fr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.