Assess whether a proposed set of variables is a key

is_key(data, cols)

Arguments

data

A data frame or tibble

cols

A character vector of column names to be considered as a key

Value

Logical value: `TRUE` if the specified column combination is a key, `FALSE` otherwise

Examples

data(college)
is_key(college, "city")
#> [1] FALSE