day_to_num | R Documentation |
day_to_num
converts the days of the week from
character
format into numeric format for use in n_day
.
day_to_num(x, ignore_case = TRUE)
x |
A character string containing days of the week in full (e.g. "Friday") or abbreviated (e.g. "Fri") form. |
ignore_case |
Logical. If TRUE, the case of |
The Date
and POSIXt
classes within R treat Sunday as
day 0 in a week, and Saturday as day 6. day_to_num
also treats Sunday
as day 0 (as opposed to day 7) for the sake of consistency.
days_of_week
for returning a vector of the days of the week.
weekdays
for converting a date into the day of the week.
n_day
for calculating the number of occurrences of a day of
the week in a set time period.
day_to_num(c("Monday", "Tuesday", "Wed")) day_to_num(days_of_week()) day_to_num(weekdays(lubridate::dmy(01012020)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.