-
Notifications
You must be signed in to change notification settings - Fork 991
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
coalesce vectors of type list #3712
Comments
differences reported in tweet: coalesce(list(1, NA), list(NA, 2))
# The first argument is a list, data.table or data.frame. In this case there should be no other arguments provided. is a result of API improvement implemented in 1f0bcc7 where coalesce(list(c(1, NA), c(NA, 2)))
#[1] 1 2 there is no gain for being consistent to dplyr/hutils in this case as they do nothing, this is related to point 1 above. never heard about tidy dots, could anyone provide a reference to R manual? or is it tidyverse-only feature? coalesce(1:2, 1:3)
#Error in coalesce(1:2, 1:3) :
Item 2 is length 3 but the first item is length 2. Only singletons are recycled. error, as it is now, it is definitely better, same as dplyr, unlike hutils coalesce(factor(NA,"a"), factor("a",c("a","b")))
#Error in coalesce(factor(NA, "a"), factor("a", c("a", "b"))) :
Item 2 is a factor but its levels are not identical to the first item's levels. being consistent to dplyr/hutils here doesn't seem to be great, they result into NAs. Ideally would be to merge factor levels. I would say current DT behaviour is acceptable, if we want to change this we should merge levels. |
related change coming to dplyr tidyverse/dplyr#5334 |
Thanks to Antoine Fabri for reporting here:
https://twitter.com/antoine_fabri/status/1151965060522237971
NB: there are 4 images in that tweet to consider.
The text was updated successfully, but these errors were encountered: