duplicated determines which rows of a data table have duplicate keys
of rows with smaller subscripts, and returns a logical vector
indicating which rows are duplicates by key.
unique returns a data table with duplicated rows (by key) removed.
Usage
## S3 method for class 'data.table':
duplicated(x, ...)
## S3 method for class 'data.table':
unique(x, ...)
Arguments
x
A data.table.
...
Not used at this time.
Value
duplicated returns a logical vector of length nrow(x)
indicating which rows are duplicates by key.
unique returns a data table with duplicated rows (by key) removed.
Details
Because data.tables are sorted by key, tests for duplication are
relatively quick.
Note that only keys are checked for duplication. Unkeyed columns are
not checked.