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

Vectorizing 'yearmon' elements may not preserve their attributes #5

Open
ghost opened this issue Sep 27, 2017 · 5 comments
Open

Vectorizing 'yearmon' elements may not preserve their attributes #5

ghost opened this issue Sep 27, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 27, 2017

Hello,

I have been reproducing the examples that you have in Business Science and this warning is shown and therefore the dates doesn't appear like those you have in the blog post. I have seen that it's something related with dplyr...

This problem appears with the function sw_sweep

Warning messages:
1: In bind_rows_(x, .id) :
  Vectorizing 'yearmon' elements may not preserve their attributes
2: In bind_rows_(x, .id) :
  Vectorizing 'yearmon' elements may not preserve their attributes 

A reproducible example exist in this vignette

Cheers

@mdancho84
Copy link
Contributor

Yes, we are aware of this issue, and we've requested changes to retain yearmon and yearqtr classes when binding rows. The dplyr issue is: tidyverse/dplyr#2457

@sco-lo-digital
Copy link

A way to get around it is to use zoo::as.Date(., frac=1) to coerce the yearmon or yearqtr object to a date. Then unnest has no problem with it.

@mdancho84
Copy link
Contributor

Nice hack!

@ghost
Copy link
Author

ghost commented Oct 17, 2017

The solution that I took it was convert to dates using zoo::as.Date.yearmon

@SuperJohn
Copy link

In reference to the example in the vignette, Forecasting Multiple Models, how do apply these hacks to resolve this issue? I can't figure out how or where to apply "zoo::as.Date(., frac=1)" to reconcile my dates. Thanks!

models_tbl_fcast_tidy %>%
  unnest(sweep) 

# Warning....1: In bind_rows_(x, .id)....Vectorizing 'yearmon' elements may not preserve their attributes

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

3 participants