Converts a ts object, numeric vector, explicit data-frame columns, or an
existing ts_df to the package's lightweight time-series structure.
Examples
as_ts_df(ts(1:4, frequency = 4))
#> time value
#> 1 1 1
#> 2 2 2
#> 3 3 3
#> 4 4 4
as_ts_df(c(3, 5, 8))
#> time value
#> 1 1 3
#> 2 2 5
#> 3 3 8
as_ts_df(data.frame(month = 1:3, demand = c(10, 12, 15)), time = "month", value = "demand")
#> time value
#> 1 1 10
#> 2 2 12
#> 3 3 15