forge (version 0.2.0)

certify: Ensure Conditions on a Value

Description

Checks that the input value satisfies specified conditions

Usage

certify(x, ..., allow_null = FALSE, id = NULL, return_id = FALSE)

gt(l)

gte(l)

lt(u)

lte(u)

bounded(l = NULL, u = NULL, incl_lower = TRUE, incl_upper = TRUE)

Arguments

x

The value to be checked.

...

Conditions to be checked; should be functions that return TRUE/FALSE.

allow_null

Whether to allow null input.

id

Name given to the input to aid the user in identifying the bad value.

return_id

Whether to return the ID as an attribute. This should only be set to TRUE when piping the result to another forge function. Defaults to FALSE.

l

Lower bound for the inequality condition.

u

Upper bound for the inequality condition.

incl_lower

Whether to include the left endpoint.

incl_upper

Whether to include the right endpoint.