is.function               package:base               R Documentation

_I_s _a_n _O_b_j_e_c_t _o_f _T_y_p_e (_P_r_i_m_i_t_i_v_e) _F_u_n_c_t_i_o_n?

_D_e_s_c_r_i_p_t_i_o_n:

     Checks whether its argument is a (primitive) function.

_U_s_a_g_e:

     is.function(x)
     is.primitive(x)

_A_r_g_u_m_e_n_t_s:

       x: an R object.

_D_e_t_a_i_l_s:

     'is.function' is generic: you can write methods to handle specific
     classes of objects, see InternalMethods.

     'is.primitive(x)' tests if 'x' is a primitive function (either a
     '"builtin"' or '"special"' as from 'typeof')?

_V_a_l_u_e:

     'TRUE' if 'x' is a (primitive) function, and 'FALSE' otherwise.

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

     is.function(1) # FALSE
     is.function(is.primitive)  # TRUE: it is a function, but ..
     is.primitive(is.primitive) # FALSE:it's not a primitive one, whereas
     is.primitive(is.function)  # TRUE: that one *is*

