This help topic is for R version 0.90. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/stop.html
stop {base}R Documentation

Stop Function Execution

Description

stop stops execution of the current expression, prints the message given as its argument, then executes an error action.

Usage

stop(message)

Arguments

message

a character vector (of length 1) or NULL.

Details

The error action is controlled by the current error handler set by options(error=). The default behaviour (the NULL error-handler) in interactive use is to return to the top level prompt, and in non-interactive use to (effectively) call q("no", status=1, runLast=FALSE).

See Also

warning, restart to catch errors and retry, and options for setting error handlers.

Examples


if(iter > 10) stop("too many iterations")

[Package base version 0.90 ]