Description Usage Arguments Details Value See Also Examples
Get or set the body of a function.
1 2 | body(fun = sys.function(sys.parent()))
body(fun, envir = environment(fun)) <- value
|
fun |
a function object, or see ‘Details’. |
envir |
environment in which the function should be defined. |
value |
an object, usually a language object: see section ‘Value’. |
For the first form, fun
can be a character string
naming the function to be manipulated, which is searched for from the
parent frame. If it is not specified, the function calling
body
is used.
The bodies of all but the simplest are braced expressions, that is
calls to {
: see the ‘Examples’ section for how to
create such a call.
body
returns the body of the function specified. This is
normally a language object, most often a call to {
, but
it can also be an object (e.g., pi
) to be the return value of
the function.
The replacement form sets the body of a function to the
object on the right hand side, and (potentially) resets the
environment of the function. If value
is of class
"expression"
the first element is used as the body: any
additional elements are ignored, with a warning.
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.