Suggest ratio checks
data.frame
, used to generate the checks
character
optionally the subset of variables to be used.
file to which the checks will be written to.
threshold for abs correlation to be included (details)
number of digits for rounding
suggest_ratio_check
returns validate::validator()
object with the suggested rules.
write_ratio_check
write the rules to file and returns invisibly a named list of check for each variable.
data(SBS2000, package="validate")
# generates upper and lower checks for the
# ratio of two variables if their correlation is
# bigger then `lin_cor`
suggest_ratio_check(SBS2000, lin_cor=0.98)
#> Object of class 'validator' with 10 elements:
#> RA1 : turnover >= 0 * total.rev
#> RA2 : turnover <= 9.07 * total.rev
#> RA3 : other.rev >= -0.1 * staff.costs
#> RA4 : other.rev <= 34.55 * staff.costs
#> RA5 : other.rev >= -0.01 * total.costs
#> RA6 : other.rev <= 1.27 * total.costs
#> RA7 : staff.costs >= 0 * total.costs
#> RA8 : staff.costs <= 0.99 * total.costs
#> RA9 : other.rev >= -2.8 * profit
#> RA10: other.rev <= 4.72 * profit