How to find the day of a week from a data frame in R?
https://www.tutorialspoint.com/how-to-find-the-day-of-a-week-from-a-data-frame-in-r
-
13-09-2020 - |
سؤال
How to find the day of a week from a data frame in R?
It can be done by using weekdays function.
Example
< df = data.frame(date=c("2020-07-01", "2020-08-10", "2020-11-15")) < df$day <- weekdays(as.Date(df$date)) < df date day 1 2020-07-01 Wednesday 2 2020-08-10 Monday 3 2020-11-15 Sunday
Advertisements
لا تنتمي إلى Tutorialspoint