what_wday()
what_wday(abbr = TRUE)
what_wday(Sys.Date() + -1:1) # Date (as vector)
what_wday(Sys.time()) # POSIXct
what_wday("2020-02-29") # string (of valid date)
what_wday(20200229) # number (of valid date)
# date vector (as characters):
ds <- c("2020-01-01", "2020-02-29", "2020-12-24", "2020-12-31")
what_wday(when = ds)
what_wday(when = ds, abbr = TRUE)
# time vector (strings of POSIXct times):
ts <- c("1969-07-13 13:53 CET", "2020-12-31 23:59:59")
what_wday(ts)
# fame data:
greta_dob <- as.Date(fame[grep(fame$name, pattern = "Greta") , ]$DOB, "%B %d, %Y")
what_wday(greta_dob) # Friday, of course.
Run the code above in your browser using DataLab