[Rd] Getting ... without evaluating it?

Duncan Murdoch murdoch at stats.uwo.ca
Thu May 19 11:49:59 CEST 2005


I'd like a function to get an unevaluated copy of its argument list, 
including ... .  That is, I'd like

f <- function(...) {
   args <- <what goes here??>
   args
}

when called as

f(a = 1+1, b = foo)

to return something like list(a = quote(1+1), b = quote(foo)).  If I use 
args <- list(...) then it tries to evaluate the arguments and dies 
(because foo doesn't exist).  If I use args <- substitute(...) then it 
gives just 1+1, it doesn't keep the names or give the whole list.

Is this possible?

Duncan Murdoch



More information about the R-devel mailing list