-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Ignore nulls for n_distinct() #1052
Comments
What makes this particularly problematic is that while this works fine:
...this does not:
which makes this rather impossible to "work around" ourselves. |
For a workaround, you can do e.g.
|
Thanks for that suggestion Romain. I tried that on my dataset above. But I got -
|
I think |
Thanks! Now I'm able to port more code over from sqldf to dplyr. |
Consider the following -
This says 1 order for term 6 where it should be 0. This is because n_distinct does not ignore nulls. I guess it makes sense in some cases, so ideally a flag to ignore nulls would be useful.
PS, Most databases will ignore null by default. R's distinct will not.
Thanks,
The text was updated successfully, but these errors were encountered: