Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to support other date-time classes as indices other than yearmonth/yearquarter? #272

Open
zemw opened this issue Feb 3, 2022 · 1 comment

Comments

@zemw
Copy link

zemw commented Feb 3, 2022

Currently tsibble only supports native date-time classes and tsibble's internally defined classes (yearweek, yearmonth, yearquarter). The problem is only packages from tidyverts recognises these date-time classes. For example, ggplot2 does not recognise yearmonth natively without specifying scale_x_yearmonth. Furthermore, as yearmonth/yearquarter stores values as integers internally rather than fractions of the year (year plus 0 for January, 1/12 for February, 2/12 for March and so on), it is very hard to convert tsibble to ts or zoo objects and makes it prohibitive to interoperate with other time series packages.

What's better to expect:

  • tsibble works just like tibble without additional caution (works with ggplot2 and other tidyverse operations smoothly) only with enhanced time series features.
  • tsibble works with zoo::yearmon or zoo::yearqtr as time indices. This will make tsibble much more versatile and interoperable.
  • It would be even better if tsibble provides functions to coerce to and from non-tidy time series class (e.g. ts).
@earowang
Copy link
Member

earowang commented Oct 9, 2022

FYI:

  • {tsibble} supports zoo::yearmon and zoo::yearqtr.
  • as_tsibble() handles the coercion of ts to a tsibble, and as.ts() vice versa. The {tsbox} package provides more functions to coerce between time series classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants