Skip to contents

When the YAML declares a value: block, every non-missing cell must be one of the listed integer codes. Values outside that set are unexpected and may indicate a recoding error, a new survey version, or missing-code contamination.

Usage

.validate_column_values(col_vec, valid_set, var, dataset_label = "")

Arguments

col_vec

Vector of values from one column.

valid_set

Integer vector of valid values from config$value_map.

var

Variable name.

dataset_label

Label for warning messages.

Value

A one-row issue data.table if unexpected values exist, otherwise NULL.

Details

Comparison is done on the integer representation of both sides so that a character column "1" is correctly matched against numeric key 1.