I would like to convert these dates with format YYYYMMDD to a Date class.
dates <- data.frame(Date = c(\"20130707\", \"20130706\", \"20130705\", \"2013070
You need to provide the Date column, not the entire data.frame.
Date
data.frame
R> as.Date(dates[["Date"]], "%Y%m%d") [1] "2013-07-07" "2013-07-06" "2013-07-05" "2013-07-04"