We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
uniqueN has different behavior than duplicated and unique. Here's an example:
uniqueN
duplicated
unique
col1 <- c(1,2,3,2,5,3,2) col2 <- c(0,9,8,9,6,5,4) example <- data.table(col1,col2) setkey(example,col1) example[duplicated(example), .N] #[1] 3 example[, .N] - uniqueN(example) #[1] 1 example[, .N] - unique(example)[, .N] #[1] 3
But when key is set on all columns, they behave the same...
setkey(example,col1,col2) example[duplicated(example), .N] #[1] 1 example[, .N] - unique(example)[, .N] #[1] 1 example[, .N] - unique(example)[, .N] #[1] 1
It would be nice for uniqueN to have a "by" argument which by default should check on the key columns
The text was updated successfully, but these errors were encountered:
9ef6a25
arunsrinivasan
No branches or pull requests
uniqueN
has different behavior thanduplicated
andunique
. Here's an example:But when key is set on all columns, they behave the same...
It would be nice for
uniqueN
to have a "by" argument which by default should check on the key columnsThe text was updated successfully, but these errors were encountered: