Added basic nargin function
This commit is contained in:
parent
762173ac53
commit
03089d7e42
1 changed files with 11 additions and 0 deletions
11
R/nargin.R
Normal file
11
R/nargin.R
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#' @title Number of function input arguments
|
||||||
|
#' @description Returns the number of arguments passed to the parent function
|
||||||
|
#' @return An integer
|
||||||
|
#' @author Waldir Leoncio
|
||||||
|
#' @note This function only makes sense inside another function
|
||||||
|
nargin <- function() {
|
||||||
|
# FIXME: returning 0 because it is using its own envir instead of parent's
|
||||||
|
print(parent.env(environment()))
|
||||||
|
length(as.list(match.call(envir = parent.env(environment())))) - 1
|
||||||
|
# length(ls(envir=parent.env(environment()))) - 1
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue