| assert {checkmate} | R Documentation |
You can call this function with an arbitrary number of of check*
functions. The resulting assertion is successful, if combine is
“or” (default) and at least one check evaluates to TRUE or
combine is “and” and all checks evaluate to TRUE.
Otherwise, assert throws an informative error message.
assert(..., combine = "or", .var.name)
... |
[any] |
combine |
[ |
.var.name |
[character(1)] |
Throws an error if all checks fails and invisibly returns
TRUE otherwise.
x = 1:10
assert(checkNull(x), checkInteger(x, any.missing = FALSE))
## Not run:
x = 1
assert(checkChoice(x, c("a", "b")), checkDataFrame(x))
## End(Not run)