How do I get the names of paramaters used for ellipsis in a function call, independent whether they are packed into a list or not?
The following function works pretty fine if the parameters are passed directly into the function.
foo <- function(...) {
sapply(substitute(...()), deparse)
}
a <- 1:3
b <- 2:6
foo(a, b)
result: "a" "b"
Now I pack the parameters explicitly into a list, to make my code more pipe-friendly:
foo(list(a, b))
result: "list(a, b)"
The function foo should also work with that, to return only the names a and b. How to handle this within function foo?
Many thanks in advance.