I have a simple ts object which contains daily values (frequency = 365). When I import it into tsibble via as_tsibble I do not get exactly daily data. I get timestamps that are closed to daily but have a small offset.
Here is a simple reprex showing the issue: as you can see the timestamps have slight 9 seconds offset.
Any workaround for this?
library(tsibble); as_tsibble(ts(1:3, frequency = 365, start = 2010))
#> # A tsibble: 3 x 2 [1s]
#> index value
#>
#> 1 2010-01-01 00:00:00 1
#> 2 2010-01-02 00:00:09 2
#> 3 2010-01-02 23:59:46 3
A tsibble is a time-aware tibble. It uses a date column as a time index (and if needed, one or more key columns). For regularly-spaced data it stores the interval between observations, which appears in the [
] when printed to Console. The tsibble package uses that interval for many of its functions. [1M] is for monthly and [1m] is for minutes. For irregular-spaced data, it is [!]. I think that to change the time interval from seconds to days you need to use tsibble's mutate() on the index column rather than myData$index = . Then again, I am trying to quickly learn tsibble and the other new tidyverts forecasting packages for a fall class, so am definitely not an authority.