Create DayOfWeek column from datetime string in R.
data = read.csv('somefiles')
data$DayOfWeek = mapply(function(r){
as.factor(weekdays(strptime( r , format = "%Y-%B-%d %H:%M:%S" ))
},
data$START_TIME
);
Written by heytitle
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#R
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#