strictly_nonunique: Return only those rows where rows per group is > 1.

Description Usage Arguments Value Examples

Description

For internal use only. It returns only rows corresponding to those groups where the number of rows > 1L. This is equivalent to doing DT[, if (.N>1L) .SD, by=c(...)].

Usage

1
strictly_nonunique(x, cols = names(x))

Arguments

x

A data.table.

cols

Character vector of column names (from x).

Value

A data.table.

Examples

1
2
3
4
5
6
7
## Not run: 
require(data.table)
dt <- data.table(x=c(1,1,1,2,2), y=c(3,3,4,5,6))
strictly_nonunique(dt) # Only 1,3 occurs more than once
strictly_nonunique(dt, "x") # all values occur more than once

## End(Not run)

openanalytics/gread documentation built on May 24, 2019, 2:29 p.m.