Learn R Programming

statar (version 0.1.3)

find_duplicates: returns duplicated rows

Description

returns duplicated rows

Usage

find_duplicates(x, ..., gen = "N")

find_duplicates_(x, vars, gen = "N")

Arguments

x
a data.table
...
Variables to group by. Default is the key, or everything is the data.table is not keyed.
gen
A character that specifies the name of a new variable with the number of duplicates. Default to "N".
vars
Used to work around non-standard evaluation.

Value

  • a data.table with groups that have duplicates.

Examples

Run this code
library(data.table)
DT <- data.table(a = rep(1:2, each = 3), b = 1:6)
find_duplicates(DT, a)

Run the code above in your browser using DataLab