Reputation: 3764
I have two functions
fn1 <- function(...) {
fn2(...)
}
I have a second function
fn2 <- function(...) {
match.call(expand.dots = FALSE)$...
}
Calling the first function with a symbol does not return the expected value
fn1(test)
# [[1]]
# ..1
I would expect test
to be returned (a symbol
).
Upvotes: 1
Views: 47
Reputation: 887028
We can use substitute
fn2 <- function(...) {
eval(substitute(alist(...) ))
}
fn2(test)
#[[1]]
#test
fn1(test)
#[[1]]
#test
Upvotes: 2