body(fun=sys.function(sys.parent())) body(obj) <- list
fun
is a function then the body of that
function is returned.
If fun
is a character string then the function with that name
is found and used.
If fun
is not specified then the function calling body
is used.
The assignment form sets the body of a function obj
to the
list
on the right hand side.
alist
, args
, function
.body(body) f <- function(x) x^5 body(f) <- expression(5^x) f(3) # = 125 str(body(f))