assert | R Documentation |
FALSE
Terminates the execution with an error message if the given conditional statement is FALSE
assert(
flag,
err_msg = "Assertion Error !",
err_src = paste(deparse(sys.calls()[[max(sys.nframe() - 1, 1)]]), collapse = "")
)
flag |
A boolean: Condition to be checked |
err_msg |
A character string: Message to be displayed |
x = 1
assert(x > 1, "Argument x can not be greater than 1")
Error in assert(x > 1, "Argument x can not be greater than 1") :
Argument x can not be greater than 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.