variable_allowed_values: Internal Function: Check allowed values for a single variable

Description Usage Arguments See Also Examples

View source: R/data-check.R

Description

This is intended to be called from data_allowed_values. Prints a warning message on a failed check.

Usage

1
variable_allowed_values(x, x_name, allowed_values)

Arguments

x

vector: variable to check

x_name

character: name of variable to print in warning

allowed_values

vector: values the variable is allowed to take

See Also

Other functions to check data format: data_check_table, data_check, data_foreign_key, data_internal

Examples

1
2
3
4
5
data(lic)
variable_allowed_values(lic$type, "lic-type", c("hunt", "fish", "combo"))

x <- c(NA, "hi", 1, lic$type)
variable_allowed_values(x, "lic-type", c("hunt", "fish", "combo"))

southwick-associates/salic documentation built on Nov. 5, 2019, 9:13 a.m.