tidyverse / funs

Collection of low-level functions for working with vctrs
Other
34 stars 7 forks source link

Rewrite `if_else()` so that `size` comes from `condition` #57

Closed DavisVaughan closed 3 years ago

DavisVaughan commented 3 years ago

Shouldn't the size of the output in if_else() come from condition alone - rather than the common size of all inputs? That seems like the most predictable behavior, and is what dplyr::if_else() does. This PR updates if_else() so that size only comes from condition

This also updates the code style to use _common() functions and avoid two calls to is.na()

DavisVaughan commented 3 years ago

Sounds great, feel free to update as needed, thanks!