KOF-ch / tstools

A time series toolbox for official statistics
11 stars 4 forks source link

long_to_ts shifts time when trimming NAs #286

Closed HomoCodens closed 5 years ago

HomoCodens commented 5 years ago
tstools::long_to_ts(
  data.frame(
    series = "a",
    date = c("2019-12-31", "2020-12-31", "2021-12-31"),
    value = c(1, 2, NA)
  )
)
#> $a
#> Time Series:
#> Start = 2020 
#> End = 2021 
#> Frequency = 1 
#> [1] 1 2

Thanks to streichers for the tip.

HomoCodens commented 5 years ago

This happens when reading in swissdata set "ch.fso.na.constr.build"