This function checks if a specified column exists in a given data table and has unique values. If the column does not exist or has non-unique values, an error is thrown.

check_key_column(dt, col)

Arguments

dt

A data table to check

col

A character string specifying the name of the column to check

Value

nothing if the column exists and has unique values, otherwise an error is thrown

Examples

if (FALSE) {
  RDBEScore:::check_key_column(H1Example$DE, "DEid")
}