| weekday {plgraphics} | R Documentation |
Get Day of Week or Year, Month, Day
Description
From Dates, obtain the day of the week or the year, month and day
Usage
weekday(date, month = NULL, day = NULL, out = NULL, factor = FALSE)
ymd(date)
Arguments
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
|
Value
For weekdays,
the output is as described above, depending on
factor and out.
Note
The functions call functions from the chron
package
Author(s)
Werner A. Stahel
See Also
Examples
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
[Package plgraphics version 1.2 Index]