Learn R Programming

validatetools (version 0.6.1)

is_implied_by: Find which rule(s) imply a rule

Description

Find out which rules are causing rule_name(s) to be redundant. A rule set can contain rules that are implied by the other rules, so it is superfluous, see examples.

Usage

is_implied_by(x, rule_name, ..., verbose = interactive())

Value

character with the names of the rule that cause the implication.

Arguments

x

validate::validator() object with rule

rule_name

character with the names of the rules to be checked

...

not used

verbose

if TRUE print information to the console

See Also

Other redundancy: detect_fixed_variables(), detect_redundancy(), remove_redundancy(), simplify_fixed_variables(), simplify_rules()

Examples

Run this code
rules <- validator( rule1 = x > 1
                  , rule2 = x > 2
                  )

# rule1 is superfluous
remove_redundancy(rules, verbose=TRUE)

# rule 1 is implied by rule 2
is_implied_by(rules, "rule1", verbose=TRUE)

rules <- validator( rule1 = x > 2
                  , rule2 = x > 2
)

# standout: rule1 and rule2, oldest rules wins
remove_redundancy(rules, verbose=TRUE)

# Note that detection signifies both rules!
detect_redundancy(rules)


Run the code above in your browser using DataLab