validate_factor_table: Check minimum factor-table structure

View source: R/validation.R

validate_factor_tableR Documentation

Check minimum factor-table structure

Description

Confirm that a factor table contains term_name and term_value and that every term_value is numeric or coercible to numeric. This function does not check for duplicate lookup keys; use find_duplicate_factors() for that.

Usage

validate_factor_table(factor_table, max_vars = 12)

Arguments

factor_table

A data frame containing rating factors.

max_vars

A nonnegative integer giving the number of variable-level slot pairs to add before validation.

Value

Invisibly returns TRUE if validation succeeds. Otherwise, the function stops with an error.

Examples

ex <- example_rating_plan()

isTRUE(
  validate_factor_table(
    ex$plan$factor_table,
    max_vars = ex$plan$max_vars
  )
)

ratingtables documentation built on Sept. 6, 2026, 1:06 a.m.