days_of_week | R Documentation |
days_of_week
returns a vector of the days of the week in
full (e.g. "Friday") or abbreviated (e.g. "Fri") form. It exists because I'm
lazy and don't like typing them all out.
days_of_week(abbr = FALSE)
abbr |
Logical. If FALSE, returns the days of the week in full form (e.g. "Friday"). If TRUE, it returns days in abbreviated form (e.g. "Fri"). The default value is FALSE. |
The Date
and POSIXt
classes within R treat Sunday as
day 0 in a week, and Saturday as day 6. As a vector cannot have an element
at position zero, days_of_week
returns Sunday as its seventh element.
The positions of the rest of the days within days_of_week
are
consistent with the order of the days of the week within the Date
and
POSIXt
classes.
day_to_num
for converting the output of days_of_week
into numeric values.
n_day
for calculating the number of occurrences of a day of
the week in a set time period.
days_of_week() days_of_week(abbr = TRUE)[3]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.