check_key_column: Check if a column exists in a data table and has unique...

View source: R/utils.R

check_key_columnR Documentation

Check if a column exists in a data table and has unique values

Description

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.

Usage

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

## Not run: 
  RDBEScore:::check_key_column(H1Example$DE, "DEid")

## End(Not run)

ices-tools-dev/icesRDBES documentation built on April 17, 2025, 1:58 p.m.