Re: [R] getting multiple argument names

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Fri, 27 Jun 2008 14:26:20 -0400

Try:

 RSiteSearch("names of objects passed as ...")

On Fri, Jun 27, 2008 at 11:48 AM, whizvast <whizvast_at_gmail.com> wrote:
>
> hi, all-
>
> i wrote a function that accept multiple arguments, but don't know how to
> assign names automatically. run the following code:
>
> foo <- function (...) {
> x = list(...)
> names(x) <- deparse(substitute(...))
> x
> }
> a = 1; b = 2; c = 3
> y <- foo( a, b, c)
> names(y)
>
> as you can see, only the first items are correctly named.
> how do i correct this problem?
>
>
>
> --
> View this message in context: http://www.nabble.com/getting-multiple-argument-names-tp18158010p18158010.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_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_at_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. Received on Fri 27 Jun 2008 - 18:30:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 27 Jun 2008 - 18:31:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive