nargs                  package:base                  R Documentation

_T_h_e _N_u_m_b_e_r _o_f _A_r_g_u_m_e_n_t_s _t_o _a _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     When used inside a function body, `nargs' returns the number of
     arguments supplied to that function.

_U_s_a_g_e:

     nargs()

_S_e_e _A_l_s_o:

     `args', `formals' and `sys.call'.

_E_x_a_m_p_l_e_s:

     tst <- function(a, b = 3, ...) {nargs()}
     tst() # 0
     tst(clicketyclack) # 1 (even non-existing)
     tst(c1, a2, rr3) # 3

     nargs()# not really meaningful

