Access to and Manipulation of the Body of a Function

Usage

body(fun=sys.function(sys.parent()))
body(obj) <- list

Value

If 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.

See Also

alist, args, function.

Examples

body(body)
f <- function(x) x^5
body(f) <- expression(5^x)
f(3) # = 125
str(body(f))


[Package Contents]