stop(message="") warning(message="")
warning prints a similar warning message at the end of evaluation of the expression, but does not affect execution.
The error option (see options) specifies the action to be taken when a dump occurs; the two main choices are discussed in the dump.calls help file.
The warn option controls the behavior when a warning is encountered. Actions range from ignoring the warning message totally (warn=-1), generating the message at the end of the top level expression (warn=0), generating the message immediately (warn=1), or causing the warning to behave as an error (warn=2).
warning(paste("Rank is", n, "should be", ncol(x))) if(any(is.na(x))) stop("NAs are not allowed in x")