return_from | R Documentation |
While base::return()
can only return from the current local
frame, return_from()
will return from any frame on the
current evaluation stack, between the global and the currently
active context.
return_from(frame, value = NULL)
frame |
An execution environment of a currently running function. |
value |
The return value. |
fn <- function() {
g(current_env())
"ignored"
}
g <- function(env) {
h(env)
"ignored"
}
h <- function(env) {
return_from(env, "early return")
"ignored"
}
fn()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.