isColsUniqueIdentifier: Indicates if given fields are unique identifiers of a...

Description Usage Arguments Value Examples

View source: R/isColsUniqueIdentifier.R

Description

Indicates if given fields allow for unique identification of rows i.e. if they can be teated as keys of the data.table.

Usage

1
isColsUniqueIdentifier(dt_data, v_s_cols = NULL)

Arguments

dt_data

a data.table.

v_s_cols

a character vector of column names in dt_data which we expect allow for unique idenfication.

Value

A boolean of whether values in v_s_keys allow for unique idenfication of rows in dt_data.

Examples

1
2
3
4
library(data.table)
dt_data <- data.table(var1 = c(1,1,2,2) , var2 = c("a", "b" , "a","b") )
isColsUniqueIdentifier(dt_data, v_s_cols = "var1")
isColsUniqueIdentifier(dt_data, v_s_cols = c("var1", "var2"))

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