Is there a way to “access” all passed arguments in a function? I beleive this can be done i javascript through the arguments array, is there an equivalent in R?
myfunc <- function() {
print(arguments[1])
print(arguments[2])
}
R> myfunc("A","B")
[1] "A"
[1] "B"
Technically, your function has no arguments, so passing arguments to it is an error.
That said, at minimum you would need
.... If you do that, you can useliston...and then access the names of your copy of.... For example:Another approach would be to parse the call with
match.call. For example: