write_cond_rule {validatesuggest}R Documentation

Suggest a conditional rule

Description

Suggest a conditional rule based on a association rule. This functions derives conditional rules based on the non-existance of combinations of categories in pairs of variables. For each numerical variable a logical variable is derived that tests for positivity. It generates IF THEN rules based on two variables.

Usage

write_cond_rule(d, vars = names(d), file = stdout())

suggest_cond_rule(d, vars = names(d))

Arguments

d

data.frame, used to generate the checks

vars

character optionally the subset of variables to be used.

file

file to which the checks will be written to.

Value

suggest_cond_rule returns validate::validator() object with the suggested rules. write_cond_rule returns invisibly a named list of ranges for each variable.

Examples

data(retailers, package="validate")

# will generate check for all columns in retailers that are
# complete.
suggest_na_check(retailers)
data("car_owner")

rules <- suggest_cond_rule(car_owner)
rules$rules

[Package validatesuggest version 0.3.2 Index]