remove_redundancy {validatetools}R Documentation

Remove redundant rules

Description

Simplify a rule set by removing redundant rules

Usage

remove_redundancy(x, ...)

Arguments

x

validator object with validation rules.

...

not used

Value

simplified validator object, in which redundant rules are removed.

See Also

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

Examples

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

# rule1 is superfluous
remove_redundancy(rules)

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

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

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

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



[Package validatetools version 0.5.2 Index]