write_range_check {validatesuggest}R Documentation

Suggest a range check

Description

Suggest a range check

Usage

write_range_check(d, vars = names(d), min = TRUE, max = FALSE, file = stdout())

suggest_range_check(d, vars = names(d), min = TRUE, max = FALSE)

Arguments

d

data.frame, used to generate the checks

vars

character optionally the subset of variables to be used.

min

TRUE or FALSE, should the minimum value be checked?

max

TRUE or FALSE, should the maximum value be checked?

file

file to which the checks will be written to.

Value

suggest_range_check returns validate::validator() object with the suggested rules. write_range_check write the rules to file and returns invisibly a named list of ranges for each variable.

Examples

data(SBS2000, package="validate")

suggest_range_check(SBS2000)

# checks the ranges of each variable
suggest_range_check(SBS2000[-1], min=TRUE, max=TRUE)

# checks the ranges of each variable
suggest_range_check(SBS2000, vars=c("turnover", "other.rev"), min=FALSE, max=TRUE)

[Package validatesuggest version 0.3.2 Index]