weekday {plgraphics} | 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
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