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

