Setting the frequency for Time series data in R

Viewed 27

I have this data where I have data entries every 10 minutes with a cycle of 24hrs from 2019-01-01 00:00:00 to 2022-07-09 23:50:00. The data has 92752 rows and the graph shows time labels from 2019 to 2020 not up to 2022 I want to set the ts function but the time labels for the data are coming out wrong. Any assistance will be highly appreciated.

dput(head(x))
structure(list(Date = structure(c(1546300800, 1546301400, 1546302000, 
1546302600, 1546303200, 1546303800), tzone = "UTC", class = c("POSIXct", 
"POSIXt")), ASA296PDI893 = c(58.7, 58.34, 58.34, 58.56, 58.74, 
58.74)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"
))

dput(tail(x))
structure(list(Date = structure(c(1657045200, 1657045800, 1657046400, 
1657047000, 1657047600, 1657048200), tzone = "UTC", class = c("POSIXct", 
"POSIXt")), ASA296PDI893 = c(90.18, 89.89, 88.9, 87.2, 85.93, 
85.93)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"
))

Code:

TS <- ts(x[,2], start = c(2019,01,01), frequency = 92752)
autoplot(TS)
0 Answers
Related