Let\'s say that I have a date in R and it\'s formatted as follows.
date 2012-02-01 2012-02-01 2012-02-02
Is there any way in R to
This should do the trick
df = data.frame(date=c("2012-02-01", "2012-02-01", "2012-02-02")) dow <- function(x) format(as.Date(x), "%A") df$day <- dow(df$date) df #Returns: date day 1 2012-02-01 Wednesday 2 2012-02-01 Wednesday 3 2012-02-02 Thursday