suggest_ratio_check: Suggest ratio checks

View source: R/ratio_check.R

write_ratio_checkR Documentation

Suggest ratio checks

Description

Suggest ratio checks

Usage

write_ratio_check(
  d,
  vars = names(d),
  file = stdout(),
  lin_cor = 0.95,
  digits = 2
)

suggest_ratio_check(d, vars = names(d), lin_cor = 0.95, digits = 2)

Arguments

d

data.frame, used to generate the checks

vars

character optionally the subset of variables to be used.

file

file to which the checks will be written to.

lin_cor

threshold for abs correlation to be included (details)

digits

number of digits for rounding

Value

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.

Examples

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)

validatesuggest documentation built on Oct. 6, 2023, 5:09 p.m.