check_arg: Check Argument Types and Return Type

Description Usage Arguments Value

View source: R/02_declare.R

Description

These functions are not designed to be used directly, we advise to use the syntaxes described in ?declare instead. check_arg checks that arguments satisfy an assertion, and if relevant make them into active bindings to make sure they always satisy it. check_output checks that the value, presumably a return value, satisfies an assertion,

Usage

1
2
3
check_output(.output, .assertion, ...)

check_arg(.arg, .assertion, ..., .bind = FALSE)

Arguments

.output

function output

.assertion

an assertion

...

additional arguments passed to assertion

.arg

function argument

.bind

whether to actively bind the argument so it cannot be modified unless it satisfies the assertion

Value

.outputif it satisfies the assertion, fails otherwise.

returns NULL invisibly, called for side effects.


typed documentation built on March 19, 2021, 5:07 p.m.