assertive: Readable check functions to ensure code integrity.

Description Details Author(s) Examples

Description

assertive contains lots of is_* functions to check the state of your variables, and assert_* functions to throw errors if they aren't in the right form.

Details

When the package loads, it creates a global option "assertive.severity" that determines what happens when an assert_* function's input fails the condition. By default, an error is thrown but it is possible to generate warnings or messages instead (see the examples).

Author(s)

Richard Cotton richierocks@gmail.com

Examples

1
2
3

Example output

[1] TRUE
$`assert_is_scalar(runif(10))`
<assertionError: is_scalar : runif(10) has length 10, not 1.>

assertive documentation built on Aug. 1, 2020, 1:07 a.m.