From henrik@bengt@@on @ending from gm@il@com  Sun Aug 12 22:00:57 2018
From: henrik@bengt@@on @ending from gm@il@com (Henrik Bengtsson)
Date: Sun, 12 Aug 2018 22:00:57 +0200
Subject: [Rd] substitute() on arguments in ellipsis ("dot dot dot")?
Message-ID: <CAFDcVCQppvvnXSgnO0CeG8Hpr7JWxFUMTnO7ORjK2JkUFKKWAw@mail.gmail.com>

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:

> exprs <- dots(1+2)
> str(exprs)
List of 1
 $ : language 1 + 2

as well as:

> exprs <- dots(1+2, "a", rnorm(3))
> str(exprs)
List of 3
 $ : language 1 + 2
 $ : chr "a"
 $ : language rnorm(3)

Is this possible to achieve using plain R code?

Thanks,

Henrik



[Rd] substitute() on arguments in ellipsis ("dot dot dot")?
Henrik Bengtsson