nargs {base} | R Documentation

## The Number of Arguments to a Function

### Description

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

### Usage

    nargs()

### See Also

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

### Examples

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

    nargs()# not really meaningful