I have a time series table named ff5 imported into R using read.csv with the date column in format of "YYYYMMDD".
I installed the xts package to better handle time series data. I tried to use the below code to convert the original data ff5 to xts format:
library(xts)
ff5_xts <- xts(ff5, order.by = as.Date(ff5["date"], "%Y%m%d"))
And I got this error message:
Error in as.Date.default(x, ...) : do not know how to convert 'x' to class “Date”
I tried a few other ways with or without xts but could not figure out how to convert this original data into time series.
Would appreciate any help!