cols_mult_vals: Find columns which introduces duplication in key columns

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

If a lot of columns have the same value in a large dataframe with unique rows, it becomes challenging to figure out which column/columns are responsible for causing this duplication. This function tries to simplify this analysis by figuring out these columns which are wreaking havoc.

Usage

1
cols_mult_vals(DT, key_cols)

Arguments

DT

A data.table or a data.frame. A data.frame will be converted to a data.table.

key_cols

A character vector containing key column names.

Value

A character vector with column names which are causing duplicates.

Examples

1
2
3
cols_mult_vals(DT = data.table::data.table(col_key = c("a", "b", "a"),
col_1 = c(3 , 5, 3), col_2 = c("v1", "v2", "v3")),
key_cols = c("col_key"))

deepjyot1991/zimplify documentation built on Dec. 19, 2021, 10:09 p.m.