Description Usage Arguments Value Author(s) See Also Examples
This function modifies an R function or expression
to insert explicit calls to return
in appropriate places in the expressions.
1 | insertReturn(expr, nested = FALSE, ...)
|
expr |
the function or expression to be potentially modified |
nested |
a logical value that controls whether we explicitly
wrap a call within a |
... |
additional parameters for methods such as the compiler object |
The original object expr
which is potentially modified.
DTL
1 2 3 4 5 6 7 8 9 10 11 | f = function(x) x + 1
insertReturn(f)
f = function(x) {
if(x < 0)
-x
else
10* xn
}
insertReturn(f)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.