powered by
A equivalent to stopifnot: if cond is TRUE then a error is thrown.
stopifnot
cond
TRUE
stopif(cond, txt)
nothing
logical: condition to test
character: error message
if (interactive()) stopif(1+1==2, "1+1 can not be 2, this is fake science!")
Run the code above in your browser using DataLab