validate icon indicating copy to clipboard operation
validate copied to clipboard

Consequence of passing a rule

Open martinschmelzer opened this issue 2 years ago • 0 comments

Im looking for an efficient way of replacing a column value if a rule passes:

df <- data.frame(A = 1:3, B = 1:3)
rules <- data.frame(name = "Rule 1", rule = "A == '1' & B == '1'", description = "")
rules <- validator(.data = rules)
satisfying(df, rules)

I looked into other packages, but I like the syntax of validate a lot. In the more complex application I will have dozens of rules where a value of a clumn will have to be corrected if the rule passes (or fails). It would be nice to have something like

df <- data.frame(A = 1:3, B = 1:3)
rules <- data.frame(name = "Rule 1", rule = "A == '1' & B == '1'", description = "", consequence  = "A = 99")
rules <- validator(.data = rules)
conclude(df, rules)

which would return the input data.frame with applied consequences.

martinschmelzer avatar Jun 30 '22 09:06 martinschmelzer