nacnudus / unpivotr

Unpivot complex and irregular data layouts in R
https://nacnudus.github.io/unpivotr/
Other
185 stars 19 forks source link

dplyr 1.1.0 compatibility #58

Closed DavisVaughan closed 1 year ago

DavisVaughan commented 1 year ago

This PR makes your package compatible with the next version of dplyr:

case_when() and if_else() now use vctrs, which generally makes them more permissive when there are varying types, but it resulted in two issues here:

We plan to submit dplyr 1.1.0 on January 27th.

This should be compatible with both dev and CRAN dplyr. It would help us out if you could go ahead and send a patch version of your package in ahead of time! Thanks!

nacnudus commented 1 year ago

Thanks for the patches and the explanations! I simplified it further to x[NA], which seems to work.

DavisVaughan commented 1 year ago

There is a big difference between x[NA] and x[NA_integer_]. The first returns a missing vector the same size as the input, the second returns a size 1 missing vector.

x <- 1:5

x[NA]
#> [1] NA NA NA NA NA

x[NA_integer_]
#> [1] NA

Created on 2022-12-23 with reprex v2.0.2.9000

nacnudus commented 1 year ago

Thanks, it's fine either way.