Skip to contents

Returns the number of arguments passed to the parent function

Usage

nargin()

Value

An integer indicating how many input arguments a function received.

Note

This function only makes sense inside another function

References

https://stackoverflow.com/q/64422780/1169233

Author

Waldir Leoncio

Examples

f <- function(x, y, z) return(nargin())
f(pi)
#> [1] 1
f(y = 6, z = 5)
#> [1] 2
f(letters)
#> [1] 1
f(letters, LETTERS, pi)
#> [1] 3