Learn R Programming

validatesuggest (version 0.3.2)

write_cond_rule: 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))

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.

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.

Examples

Run this code
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

Run the code above in your browser using DataLab