Skip to content

as_tsibble.ts() for frequencies >24 produces irregular series - use fractional years instead #325

@mitchelloharawild

Description

@mitchelloharawild

The unit test for as.ts(as_tsibble(x)) == x on EuStockMarkets currently fails. I've removed the test since the time class (POSIXct) for this style of data is inappropriate, which causes the as.ts() method to fill all the gaps of 1s frequency. A more suitable time class for this is fractional years, where 1/260th of a year can be the frequency (e.g. supported by mixtime). I'm creating this issue to track this problem and while the test itself is temporarily removed.

  freq <- frequency(EuStockMarkets)
  x <- head(EuStockMarkets)
  y <- as_tsibble(x)
  expect_equal(
    as.double(as.ts(y, frequency = freq)),
    as.double(x)
  )

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions