getRepeatedRowsByKeys: Get repeated rows by key

Description Usage Arguments Details Value Examples

View source: R/getRepeatedRowsByKeys.R

Description

Returns a data.table of the repeated rows for a given key.

Usage

1
getRepeatedRowsByKeys(dt_data, v_s_keys = NULL)

Arguments

dt_data

a data.table.

v_s_keys

a character vector of column names in dt_data.

Details

all rows of dt_data for which the combination of values of v_s_keys are repeated is returned. Additionally a new column rep_count_ is added which indicates the number of times the key combination is repeated in the data set. If there is no repeated cases function returns NULL.

Value

a data.table of all the rows which the combination of the values of v_s_keys are repeated. See details.

Examples

1
2
3
4
library(data.table)
dt_data <- data.table( unique_identifier = c(1,2,3,3,3,4,4,5), value = rnorm(8))

getRepeatedRowsByKeys(dt_data, "unique_identifier")

AlejandroKantor/akmisc documentation built on May 5, 2019, 3:51 a.m.