Re: [R] Getting ... as an unevaluated list

From: hadley wickham <h.wickham_at_gmail.com>
Date: Fri 14 Oct 2005 - 05:11:30 EST

Perfect! Thanks Peter and Gabor.

Hadley

On 13 Oct 2005 19:59:49 +0200, Peter Dalgaard <p.dalgaard@biostat.ku.dk> wrote:
> Gabor Grothendieck <ggrothendieck@gmail.com> writes:
>
> > Try this:
> >
> > cl <- as.list(match.call())
>
> or match.call(expand.dots=FALSE)$"..."
>
> >
> > On 10/13/05, hadley wickham <h.wickham@gmail.com> wrote:
> > > Hi,
> > >
> > > I'm trying to get ...as a list of unevaluated arguments, ie.
> > > substitute(list(...)) gives me an unevaluated list of the arguments,
> > > but I want a list of the unevaluated arguments.
> > >
> > > My attempts so far:
> > >
> > > (function(...) substitute(...))(a=1, b=a) # Only returns first
> > >
> > > (function(...) substitute(list(...)))(a=1, b=a) # Unevaluated list,
> > > not list of unevaluated
> > >
> > > (function(...) expression(...))(a=1, b=a)
> > >
> > > (function(...) eval(expression(...)))(a=1, b=a) # Error in eval(expr,
> > > envir, enclos) : ... used in an incorrect context
> > >
> > > (function(...) substitute(expression(...), list(...)))(a=1, b=a) #
> > > Error in (function(...) substitute(expression(...), list(...)))(a = 1,
> > > : Object "a" not found
> > >
> > > What I actually want: list(1, a)
> > >
> > > Can anyone offer any suggestions?
> > >
> > > Thanks,
> > >
> > > Hadley
> > >
> > > ______________________________________________
> > > R-help@stat.math.ethz.ch mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> > >
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> >
>
> --
> O__ ---- Peter Dalgaard ุster Farimagsgade 5, Entr.B
> c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
> (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Oct 14 05:18:57 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:51:00 EST