Normalize and validate a primary-key (pk) specification. The canonical
representation is a list with element keys containing a character vector
of column names. When x (a data.frame) is provided and validate = TRUE
the function will check that the columns exist (and optionally that they
uniquely identify rows).
Arguments
- x
Optional data.frame to validate the keys against. If
NULL, only thekeysvector is normalized.- keys
Character vector of column names comprising the primary key.
- validate
Logical; when
TRUEvalidate that columns exist (and uniqueness ifcheck_uniqueisTRUE).- check_unique
Logical; when
TRUEassert thatkeysuniquely identify rows inx(only checked whenxis provided).