I'd like to create a function to accept indefinite number of arguments. Is there a way to define a function in R?
Thanks.
I'd like to create a function to accept indefinite number of arguments. Is there a way to define a function in R?
Thanks.
you can use the dots like this for example
f <- function(...) {
arguments <- list(...)
print(arguments)
}
f(a=1, b=2)
## $a
## [1] 1
## $b
## [1] 2