consequential | R Documentation |
Check that passes in either of the two cases: - if the first parameter (anchor) is not NULL, then the second parameter (dependent) must also not be NULL, or - if the first parameter (anchor) is NULL, then the second parameter (dependent) must also be NULL
This test is generally useful if one or more parameters in a routine are required if another parameter is passed, and are therefore consequential to its presence.
consequential(anchor, dependent)
anchor |
The parameter that decides if the other must be NULL or not. |
dependent |
The parameter that is dependent on anchor being NULL or not |
## Not run:
# For assertion. This passes if either is satisfied:
# If a is not NULL, then b must also be not NULL.
# If a is NULL, then b must also be NULL.
assertthat::assert_that(
qscheck::consequential(a, b)
)
# For check
if (
qscheck::consequential(a, b)
) {}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.