list(...) evaluates the things in ... E.g., > f0 <- function(x, ...) list(...) > f0(1, warning("Hmm"), stop("Oops"), cat("some output\n"))[[2]] Error in f0(1, warning("Hmm"), stop("Oops"), cat("some output\n")) : Oops In addition: Warning message: In f0(1, warning("Hmm"), stop("Oops"), cat("some output\n")) : Hmm
You can use the odd idiom substitute(...()) to get the unevaluated ... arguments: > f1 <- function(x, ...) substitute(...()) > f1(1, warning("Hmm"), stop("Oops"), cat("some output\n")) [[1]] warning("Hmm") [[2]] stop("Oops") [[3]] cat("some output\n") Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of S Ellison > Sent: Monday, July 23, 2012 2:12 PM > To: Jochen Voß > Cc: r-help@r-project.org > Subject: Re: [R] turning R expressions into functions? > > >> One of the things I would love to add to my package would be the > >> ability to compare more than two expressions in one call. But > >> unfortunately, I haven't found out so far whether (and if so, how) it > >> is possible to extract the elements of a "..." object without > >> evaluating them. > > > >Have a look at match.call. > > ... or use > dotlist <- list(...) > > to get a list of everything included in ... > > S Ellison > > ***************************************************************** > ** > This email and any attachments are confidential. Any use...{{dropped:8}} > > ______________________________________________ > R-help@r-project.org mailing list > 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. ______________________________________________ R-help@r-project.org mailing list 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.