stop stops execution of the current expression and executes an error action. geterrmessage gives the last error message.
stop(…, call. = TRUE, domain = NULL)
geterrmessage()
| Parameter | Description |
|---|---|
… |
zero or more objects which can be coerced to character (and which are pasted together with no separator) or a single condition object. |
call. |
logical, indicating if the call should become part of the error message. |
domain |
see gettext. If NA, messages will not be translated. |
# NOT RUN {
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))
# }