weekday | R Documentation |
From Dates, obtain the day of the week or the year, month and day
weekday(date, month = NULL, day = NULL, out = NULL, factor = FALSE)
ymd(date)
date |
date(s), given as a |
month, day |
If the first argument is the year, these arguments must also be given. |
factor |
logical: Should the result be a (ordered) factor? |
out |
selection of output: either
|
For weekdays
,
the output is as described above, depending on
factor
and out
.
The functions call functions from the chron
package
Werner A. Stahel
day.of.week, month.day.year
weekday(c("2020-05-01", "2020-05-02"), factor=TRUE)
## [1] Thursday Sunday
## Levels: Sunday < Monday < Tuesday < Wednesday < Thursday < Friday < Saturday
dt <- ymd(18100+1:5)
weekday(dt)
## [1] 3 4 5 6 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.