Description Usage Arguments Value See Also Examples
These functions are generalised and simplified based on the package checkmate
.
They are used primarily for the function makeChecks
that automatically generates
checkmate-style custom validation functions.
1 2 3 4 5 6 7 | assertThat(x, cond, errormsg)
checkThat(cond, errormsg)
testThat(cond)
isThat(cond)
|
x |
Object to perform checks on |
cond |
Boolean condition to check |
errormsg |
Error message to produce |
assertThat
returns self invisibly if checks pass, otherwise error
checkThat
returns TRUE if checks pass, otherwise error message as string
testThat
returns TRUE if checks pass, otherwise FALSE
isThat
returns TRUE if checks pass, otherwise FALSE
1 2 3 4 5 6 7 | x = 1:10
cond = inherits(x, "integer")
errormsg = "Not integer"
assertThat(x, cond, errormsg)
checkThat(cond, errormsg)
testThat(cond)
isThat(cond)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.