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

Issue with agg_vec and dates #230

Closed
mitchelloharawild opened this issue Jun 23, 2020 · 2 comments
Closed

Issue with agg_vec and dates #230

mitchelloharawild opened this issue Jun 23, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mitchelloharawild
Copy link
Member

mitchelloharawild commented Jun 23, 2020

date <- fabletools:::agg_vec(Sys.Date() + 0:1)
date[2] <- fabletools:::agg_vec(NA, TRUE)
#> Error in as.Date.numeric(value): 'origin' must be supplied

Created on 2020-06-24 by the reprex package (v0.3.0)

@mitchelloharawild mitchelloharawild added the bug Something isn't working label Jun 23, 2020
@mitchelloharawild mitchelloharawild self-assigned this Jun 23, 2020
@mitchelloharawild
Copy link
Member Author

mitchelloharawild commented Jun 23, 2020

The issue is from the handling of NA within agg_vec.

as.Date(NA_real_)
#> Error in as.Date.numeric(NA_real_): 'origin' must be supplied
as.Date(NA)
#> [1] NA

Created on 2020-06-24 by the reprex package (v0.3.0)

@mitchelloharawild
Copy link
Member Author

mitchelloharawild commented Jun 23, 2020

Which is from rep_len() dropping classes:

rep_len(Sys.Date(), 3)
#> [1] 18437 18437 18437

Created on 2020-06-24 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant