is_valid_lookup_tbl: Check Validity of Lookup Table

View source: R/lookup_dt.R

is_valid_lookup_tblR Documentation

Check Validity of Lookup Table

Description

This function verifies that a lookup table meets the required structural conditions for key-based lookups. It checks that key columns are of type integer (or factors stored as integers), that each key column has a consecutive sequence of values, and that the table has the expected number of rows based on all possible combinations of key values.

Usage

is_valid_lookup_tbl(lookup_tbl, keycols, fixkey = FALSE)

Arguments

lookup_tbl

The data.table representing the lookup table.

keycols

A character vector specifying the key columns in the lookup table.

fixkey

Logical. If TRUE, the function will automatically set the key of the lookup table to the provided key columns for best performance; default is FALSE.

Value

TRUE if the lookup table is valid; otherwise, an error is raised.


ChristK/CKutils documentation built on April 11, 2025, 10:11 p.m.