

nargs {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

