- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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