[R] stopifnot() doesnt work as I expect it to. Are my expectations correct?

Vasanth Mohan vasanthcullen at gmail.com
Fri May 20 10:44:22 CEST 2016


Hi,

*stopifnot(FALSE, someOtherExpression)*

For the above code I expect stopifnot() to always say that 'FALSE is not
TRUE' regardless of what someOtherExpression is(It may evaluate to TRUE or
FALSE or throw an error). Is my expectation correct? Is that how
stopifnot() is supposed to work?

The present implementation of stopifnot() does not work like that. If
someOtherExpression would throw an error, then stopifnot() throws that
error instead of saying 'FALSE is not TRUE'.

So, I modified the source code of stopifnot() and now it works as I expect
it to.
If that is how stopifnot() is supposed to work, then kindly let me know how
I can contribute my solution

-- 
vAsAnth

The mind, once expanded to the dimensions of larger ideas, never returns to
its original size. - Oliver Wendell Holmes

	[[alternative HTML version deleted]]



More information about the R-help mailing list