EVOLUTION-MANAGER
Edit File: stop.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Stop Function Execution</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for stop {base}"><tr><td>stop {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Stop Function Execution</h2> <h3>Description</h3> <p><code>stop</code> stops execution of the current expression and executes an error action. </p> <p><code>geterrmessage</code> gives the last error message. </p> <h3>Usage</h3> <pre> stop(..., call. = TRUE, domain = NULL) geterrmessage() </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>zero or more objects which can be coerced to character (and which are pasted together with no separator) or a single condition object.</p> </td></tr> <tr valign="top"><td><code>call.</code></td> <td> <p>logical, indicating if the call should become part of the error message.</p> </td></tr> <tr valign="top"><td><code>domain</code></td> <td> <p>see <code><a href="gettext.html">gettext</a></code>. If <code>NA</code>, messages will not be translated.</p> </td></tr> </table> <h3>Details</h3> <p>The error action is controlled by error handlers established within the executing code and by the current default error handler set by <code>options(error=)</code>. The error is first signaled as if using <code><a href="conditions.html">signalCondition</a>()</code>. If there are no handlers or if all handlers return, then the error message is printed (if <code>options("show.error.messages")</code> is true) and the default error handler is used. The default behaviour (the <code>NULL</code> error-handler) in interactive use is to return to the top level prompt or the top level browser, and in non-interactive use to (effectively) call <code><a href="quit.html">q</a>("no", status = 1, runLast = FALSE</code>). The default handler stores the error message in a buffer; it can be retrieved by <code>geterrmessage()</code>. It also stores a trace of the call stack that can be retrieved by <code><a href="traceback.html">traceback</a>()</code>. </p> <p>Errors will be truncated to <code>getOption("warning.length")</code> characters, default 1000. </p> <p>If a condition object is supplied it should be the only argument, and further arguments will be ignored, with a warning. </p> <h3>Value</h3> <p><code>geterrmessage</code> gives the last error message, as a character string ending in <code>"\n"</code>. </p> <h3>Note</h3> <p>Use <code>domain = NA</code> whenever <code>...</code> contain a result from <code><a href="sprintf.html">gettextf</a>()</code> as that is translated already. </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="warning.html">warning</a></code>, <code><a href="try.html">try</a></code> to catch errors and retry, and <code><a href="options.html">options</a></code> for setting error handlers. <code><a href="stopifnot.html">stopifnot</a></code> for validity testing. <code>tryCatch</code> and <code>withCallingHandlers</code> can be used to establish custom handlers while executing an expression. </p> <p><code><a href="gettext.html">gettext</a></code> for the mechanisms for the automated translation of messages. </p> <h3>Examples</h3> <pre> iter <- 12 try(if(iter > 10) stop("too many iterations")) tst1 <- function(...) stop("dummy error") try(tst1(1:10, long, calling, expression)) tst2 <- function(...) stop("dummy error", call. = FALSE) try(tst2(1:10, longcalling, expression, but.not.seen.in.Error)) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>