detect_boundary_cat {validatetools}R Documentation

Detect domains for categorical variables

Description

Detect the allowed values for categorical variables: the rule set may constrain the categorical variables to a subset of their values. detect_boundary_cat() finds the categories that are allowed by the rule set.

Usage

detect_boundary_cat(x, ..., as_df = FALSE)

Arguments

x

validate::validator() object with rules

...

not used

as_df

return result as data.frame (before 0.4.5)

Value

data.frame with columns ⁠$variable⁠, ⁠$value⁠, ⁠$min⁠, ⁠$max⁠. Each row is a category/value of a categorical variable.

See Also

Other feasibility: detect_boundary_num(), detect_contradicting_if_rules(), detect_infeasible_rules(), is_contradicted_by(), is_infeasible(), make_feasible()

Examples

rules <- validator(
  x >= 1,
  x + y <= 10,
  y >= 6
)

detect_boundary_num(rules)

rules <- validator(
  job %in% c("yes", "no"),
  if (job == "no") income == 0,
  income > 0
)

detect_boundary_cat(rules)

[Package validatetools version 0.6.1 Index]