I would like to convert these dates with format YYYYMMDD to a Date class.
dates <- data.frame(Date = c(\"20130707\", \"20130706\", \"20130705\", \"2013070
An extra conversion to characters works for me:
dates<-as.Date(as.character(dates),format="%Y%m%d")
Without the conversion the following error occurs:
dates<-as.Date(dates,format="%Y%m%d")
Error in as.Date.numeric(dates, format = "%Y%m%d") :
'origin' must be supplied
Different error but this might help, works for POSIXct too, paste date and hours, format %Y%m%d%H