tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
527 stars 49 forks source link

Loading the {tsibble} package causes an error with {stats} #277

Closed AndrewKostandy closed 1 year ago

AndrewKostandy commented 2 years ago

Thank you for your great work with the {tsibble} package.

There appears to be an issue where loading the {tsibble} package (or running some functions from it) causes an error with the {stats} package. This in turn causes an error in other packages that use {stats} such as the {CausalImpact} package.

Below is a reprex from a response post of a collaborator in the {CausalImpact} repo:

This works:

dates <- as.Date(c("2022-01-01", "2022-01-08"))
stats::window(dates, 1)

This fails:

library(tsibble)
stats::window(dates, 1)

Error in seq.int(trunc((start - xtsp[1L]) * xfreq + 1.5), trunc((end - : 'from' must be of length 1

You can also see how this issue causes a problem with the {CausalImpact} package by reading from the below comment onwards: https://github.com/google/CausalImpact/issues/32#issuecomment-1038264276

earowang commented 1 year ago

Sorry for taking so long to responds. Yes, can confirm {tsibble} overwriting the time() function here, that causes the problem. Will fix it soon.