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

Add n_distinct() to SQL base_aggs. #873

Merged
merged 1 commit into from Aug 24, 2015
Merged

Conversation

@shea-parkes
Copy link
Contributor

@shea-parkes shea-parkes commented Jan 7, 2015

Do this to make it easier to write adaptable code with the recently
added n_distinct() convenience function available in dplyr. The
DISTINCT option to SQL's COUNT() was part of the SQL-92 standards.

Do this to make it easier to write adaptable code with the recently
added n_distinct() convenience function available in dplyr.  The
DISTINCT option to SQL's COUNT() was part of the SQL-92 standards.
@shea-parkes
Copy link
Contributor Author

@shea-parkes shea-parkes commented Jan 7, 2015

For anyone playing along at home, you can ~"Monkey Patch" this on production dplyr with this line:

assign('n_distinct', function(x) {build_sql("COUNT(DISTINCT ", x, ")")}, envir=base_agg)

@piccolbo
Copy link

@piccolbo piccolbo commented May 20, 2015

+1 useful and confirmed working

@hadley
Copy link
Member

@hadley hadley commented Aug 24, 2015

Good idea - thanks!

hadley added a commit that referenced this issue Aug 24, 2015
Add n_distinct() to SQL base_aggs.
@hadley hadley merged commit 0f71e27 into tidyverse:master Aug 24, 2015
1 check passed
krlmlr pushed a commit to krlmlr/dplyr that referenced this issue Mar 2, 2016
Add n_distinct() to SQL base_aggs.
@lock
Copy link

@lock lock bot commented Jan 19, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants