If you want to avoid the inefficiency and memory overhead of first
constructing the list and work directly on the language, then I think
?match.call is the tool you want. e.g.


> f <- function(...){
    z <- as.list(match.call())[-1]
    vapply(z,deparse,"a")
 }

> a <- 1
> b <- 2

> f(a,b)
[1] "a" "b"

I am sure that there are packages that may do this more elegantly and
perhaps reliably, though.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Tue, Feb 20, 2018 at 2:47 PM, Rolf Turner <r.tur...@auckland.ac.nz>
wrote:

> On 21/02/18 11:36, Spencer Graves wrote:
>
>> Hi, All:
>>
>>
>>        How can I get the names of all the arguments in dots(...)?
>>
>>
>>        I'm able to get the name of the first argument but not the second:
>>
>>
>>
>> deparseDots <- function(...){
>>    deparse(substitute(...))
>> }
>> a <- 1
>> b <- 2
>> deparseDots(a, b)
>> [1] "a"
>>
>>  >        I'd like to get c('a', 'b').
>>
>
> Does
>
>     names(list(...))
>
> do what you want?
>
> cheers,
>
> Rolf
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>
>
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to