Learn R Programming

wrapr (version 2.1.0)

checkColsFormUniqueKeys: Check that a set of columns form unique keys.

Description

For local data.frame only.

Usage

checkColsFormUniqueKeys(data, keyColNames)

Value

logical TRUE if the rows of data are unique addressable by the columns named in keyColNames.

Arguments

data

data.frame to work with.

keyColNames

character array of column names to check.

Examples

Run this code

d <- data.frame(key = c('a','a', 'b'), k2 = c(1 ,2, 2))
checkColsFormUniqueKeys(d, 'key') # should be FALSE
checkColsFormUniqueKeys(d, c('key', 'k2')) # should be TRUE

Run the code above in your browser using DataLab