

body {base}                                  R Documentation

_A_c_c_e_s_s _t_o _a_n_d _M_a_n_i_p_u_l_a_t_i_o_n _o_f _t_h_e _B_o_d_y _o_f _a _F_u_n_c_t_i_o_n

_U_s_a_g_e_:

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

_V_a_l_u_e_:

     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.

_S_e_e _A_l_s_o_:

     `alist', `args', `function'.

_E_x_a_m_p_l_e_s_:

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

