Evaluates each rule formula against data and records a message for
every row that violates a rule. Two modes are supported:
"first"Each row gets the message of the first rule it fails; subsequent rules are not evaluated for that row.
"all"All rules are evaluated for every row; the row receives a list of all messages for rules it fails.
Usage
ks_check_rules(data, rules, mode = c("first", "all"))Arguments
- data
A data frame.
- rules
A named list of rule objects, each with two fields:
exprA one-sided formula whose RHS is a logical expression (evaluated with
rlang::eval_tidy()) that isTRUEfor failing rows.msgCharacter scalar. Message written to failing rows.
- mode
Character. Either
"first"(default) or"all".
