nargs
Number of Arguments to Function
Description
nargs Counts the number of arguments that are passed in the
current call to the specified function.
Usage
nargs()
Value
returns the number of actual arguments (including ... arguments) in the
call to the function that calls nargs.
References
Becker, R. A., Chambers, J. M., and Wilks, A. R. 1988. The New S Language. Pacific Grove, CA: Wadsworth & Brooks/Cole Advanced Books and Software.
See Also
Examples
nargs()
# [1] NA
myfun <- function(..., a=4) nargs()
myfun() # returns 0
myfun(1:3,"bear") # returns 2
myfun(a=5, 1:3, "bear") # returns 3