powered by
return
This function modifies an R function or expression to insert explicit calls to return in appropriate places in the expressions.
insertReturn(expr, nested = FALSE, ...)
the function or expression to be potentially modified
a logical value that controls whether we explicitly wrap a call within a return call.
additional parameters for methods such as the compiler object
The original object expr which is potentially modified.
expr
compileFunction
f = function(x) x + 1 insertReturn(f) f = function(x) { if(x < 0) -x else 10* xn } insertReturn(f)
Run the code above in your browser using DataLab