| local.return | R Documentation |
In an mlocal function, local.return should be used whenever return is called, wrapped inside the return call around the return arguments.
local.return(...) # Don't use it like this!
# Correct usage: return( local.return( ...))
... |
named and unnamed list, handled the same way as |
Mark Bravington
mlocal
ffin <- function( nlocal=sys.parent()) mlocal( return( local.return( a)))
ffout <- function( a) ffin()
ffout( 3) # 3
# whereas:
ffin <- function( nlocal=sys.parent()) mlocal( return( a))
try(
ffout( 3) # error:; "return" alone doesn't work
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.