Convert yyyymmdd string to Date class in R

You need to provide the Date column, not the entire data.frame.

R> as.Date(dates[["Date"]], "%Y%m%d")
[1] "2013-07-07" "2013-07-06" "2013-07-05" "2013-07-04"

Leave a Comment