vld_spec: Specify validation checks

Description Usage Arguments See Also Examples

Description

Specify validation checks

Usage

1

Arguments

...

Validation checks (with support for quasiquotation).

See Also

vld_exprs()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
f <- function(x, y) "Pass"

## Make a positivity checker
chk_pos <- vld_spec("{{.}} is not positive" := {isTRUE(. > 0)}(x, x - y))
foo <- firmly(f, !!! chk_pos)

foo(2, 1)
## Not run: 
foo(1, 2)
## End(Not run)

egnha/rong documentation built on May 7, 2019, 9:48 p.m.