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

Update coalesce() to use vec_case_when() #6265

Merged
merged 5 commits into from
Jul 11, 2022

Conversation

DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented May 11, 2022

The main change to dplyr is that this reverts most of the changes made in #5334 to support #5326. This previously iterated over data frame input column by column, but we now fully embrace the vctrs definition of a missing value, which is when the entire row is empty for data frames. Since data frame input is probably pretty rare, we are optimizing for the simplicity of the coalesce() implementation over supporting that feature. Users that need this can just map2() over their data frames, calling coalesce() on each column.

Also:

  • Now uses vec_case_when() internally
  • New .ptype and .size arguments
  • NULL inputs are now dropped (currently they cause an obscure error)

"1b1dd312-a69e-4d4c-b094-289700c3c5f6"

@DavisVaughan DavisVaughan force-pushed the feature/coalesce-update branch from 2cdc05b to 167469f Compare July 5, 2022 17:37
@DavisVaughan DavisVaughan changed the title Port funs update of coalesce() to dplyr Update coalesce() to use vec_case_when() Jul 5, 2022
@DavisVaughan DavisVaughan force-pushed the feature/coalesce-update branch from ff4d7e2 to 2a25a2e Compare July 11, 2022 17:28
@DavisVaughan DavisVaughan merged commit a6df2a0 into tidyverse:main Jul 11, 2022
@DavisVaughan DavisVaughan deleted the feature/coalesce-update branch July 11, 2022 18:08
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

Successfully merging this pull request may close these issues.

None yet

1 participant