Primitive                package:base                R Documentation

_C_a_l_l _a "_P_r_i_m_i_t_i_v_e" _I_n_t_e_r_n_a_l _F_u_n_c_t_i_o_n

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

     '.Primitive' returns an entry point to a "primitive" (internally
     implemented) function.

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

     .Primitive(name)

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

    name: name of the R function.

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

     The advantage of '.Primitive' over '.Internal' functions is the
     potential efficiency of argument passing.  However, this is done
     by ignoring argument names and using positional matching of
     arguments, so this is discouraged for functions of more than one
     argument.

     All primitve functions are in the base name space.

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

     '.Internal'.

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

     mysqrt <- .Primitive("sqrt")
     c
     .Internal # this one *must* be primitive!
     get("if") # just 'if' or 'print(if)' are not syntactically ok.

