Skip to contents

Hard-errors if the combination of key columns is duplicated. A small composable primitive used by check_schema and reusable by bespoke checkers (e.g. a conjoint check_conjoint).

Usage

assert_key_unique(data, key)

Arguments

data

A data frame or tibble.

key

Character vector of columns that jointly identify a row.

Value

TRUE, invisibly.

See also

Examples

assert_key_unique(data.frame(resp_id = 1:3), key = "resp_id")