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

Can the messages in time_decompose be suppressed in a tidy way? #28

Open
DaveParr opened this issue May 29, 2019 · 1 comment
Open

Can the messages in time_decompose be suppressed in a tidy way? #28

DaveParr opened this issue May 29, 2019 · 1 comment

Comments

@DaveParr
Copy link

DaveParr commented May 29, 2019

Thanks for the work on the package, I've mostly been finding it really useful, apart from the following issue.

The following from the example prints a large volume of output to the console:

suppressMessages(library(tibbletime))
suppressMessages(library(anomalize))

tidyverse_cran_downloads_anomalized <- tidyverse_cran_downloads %>%
time_decompose(count, merge = TRUE, message = FALSE)

The output:

Registered S3 method overwritten by 'xts':
  method     from
  as.zoo.xts zoo 
Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo 
Registered S3 methods overwritten by 'forecast':
  method             from    
  fitted.fracdiff    fracdiff
  residuals.fracdiff fracdiff
Warning message:
Detecting old grouped_df format, replacing `vars` attribute by `groups` 

The S3 overwrite warnings are generated at the execution of time_decompose, not at the library call. This makes the output frustrating when you aware of these operations, but you can't turn them off.

What would be the recommendation to prevent these messages printing to console?

@DaveParr
Copy link
Author

DaveParr commented May 29, 2019

So I've found a workaround:

You can call:

suppressMessages(library(tibbletime))
suppressMessages(library(anomalize))
suppressMessages(library(forecast))

By forcing the library load pre-emptively and then controlling the messaging at that stage, the package is already attached, and therefore time_decompose doesn't generate the messages.

forecast seems (right now), to cover all bases: forecast, quantmod and xts.

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

1 participant