[R] an assert() function

Greg Minshall minshall at umich.edu
Tue Feb 12 16:09:55 CET 2013


Duncan,

thanks for the response.  stopifnot() looks almost right.  it's very
useful if assertion failures issue an error message pointing at the
source file/line (such as error produces); it might also be nice (but
not necessary) to allow the caller to pass in a "higher level" message
to be appended to the output.

i see the problems with vectors.  i might complain that the programmer
has made in error in their expressions.  (err on the side of over-,
rather than underreporting.)

cheers, Greg



More information about the R-help mailing list