'ts() function do not recognize data column

I have a problem with converting a data frame into a time series. I tried this code:

dat.import <- read.csv("...")

dat.import$DATE <- as.Date(dat.import$DATE)

dat <- ts(data = dat.import, start = c(1991,1), end = c(2020,1), frequency = 12)

The data column do not contain the format 1991-01-01 and so on.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source