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

drop_na() with an empty selection shouldn't be the same as no selection #1227

Closed
DavisVaughan opened this issue Nov 19, 2021 · 0 comments · Fixed by #1229
Closed

drop_na() with an empty selection shouldn't be the same as no selection #1227

DavisVaughan opened this issue Nov 19, 2021 · 0 comments · Fixed by #1229
Labels
bug an unexpected problem or unintended behavior missing values 💀

Comments

@DavisVaughan
Copy link
Member

library(tidyr)

df <- data.frame(x=c(1, NA, 2),y=c(NA, 1, 2))

# People like to use drop_na() like this
# (uses all columns)
drop_na(df)
#>   x y
#> 1 2 2

# But this currently also resolves to "use all columns"
# when really it should be "don't use any columns"
drop_na(df, starts_with("foo"))
#>   x y
#> 1 2 2

Created on 2021-11-19 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior missing values 💀
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant