Skip to content
Prev 55615 / 63424 Next

substitute() on arguments in ellipsis ("dot dot dot")?

Hi. For any number of *known* arguments, we can do:

one <- function(a) list(a = substitute(a))
two <- function(a, b) list(a = substitute(a), b = substitute(b))

and so on. But how do I achieve the same when I have:

dots <- function(...) list(???)

I want to implement this such that I can do:
List of 1
 $ : language 1 + 2

as well as:
List of 3
 $ : language 1 + 2
 $ : chr "a"
 $ : language rnorm(3)

Is this possible to achieve using plain R code?

Thanks,

Henrik