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

Documentation for uniqueN is misleading #1746

Closed
SymbolixAU opened this issue Jun 21, 2016 · 0 comments
Closed

Documentation for uniqueN is misleading #1746

SymbolixAU opened this issue Jun 21, 2016 · 0 comments
Assignees

Comments

@SymbolixAU
Copy link

SymbolixAU commented Jun 21, 2016

from ?uniqueN

uniqueN is equivalent to length(unique(x)) but much faster. It accepts atomic vectors, data.frames and data.tables. The number of unique rows are computed directly without materialising the intermediate unique data.table and is therefore memory efficient as well.


uniqueN is not equivalent to length(unique(x)) when x is a data.frame or data.table. Perhaps it should read something like:


uniqueN is equivalent to length(unique(x)) when x is a vector, and nrow(unique(x)) when x is a data.frame or data.table. The number of unique rows are computed directly without materialising the intermediate unique data.table and is therefore faster and more memory efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant