Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-21 Thread William Dunlap
p tibco.com > -Original Message- > From: peter dalgaard [mailto:pda...@gmail.com] > Sent: Monday, October 21, 2013 11:56 AM > To: Duncan Murdoch > Cc: Bert Gunter; William Dunlap; r-help@r-project.org > Subject: Re: [R] Recovering object names when using the ... argume

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-21 Thread peter dalgaard
roblem=stop("there was a >>>> problem")) >>>> i >>> >>> "x" >>> >>> "log(10)" >>> e >>> "exp(

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-19 Thread Duncan Murdoch
Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dan Abner Sent: Friday, October 18, 2013 9:06 AM To: r-help@r-project.org Subject: [R] Recovering object names when using the ... argument in a fn Hi all, I am using the ... argument to parmeterize a

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread William Dunlap
gt; -Original Message- > From: Bert Gunter [mailto:gunter.ber...@gene.com] > Sent: Friday, October 18, 2013 10:54 AM > To: William Dunlap > Cc: Dan Abner; r-help@r-project.org > Subject: Re: [R] Recovering object names when using the ... argument in a fn > > >

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread Bert Gunter
> itself > [1] "x" "log(10)" "e" > [4] "onProblem" > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-p

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread Dan Abner
Many thanks Bert! You are a big help!! On Fri, Oct 18, 2013 at 1:25 PM, Bert Gunter wrote: > That's because I screwed up! I gave you the wrong function, "f" instead of > "g" . > > Here's g: > > g <- function(...){ > sapply(as.list(match.call())[-1],deparse) > } > > and the example should now

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread William Dunlap
[mailto:r-help-boun...@r-project.org] On > Behalf > Of Dan Abner > Sent: Friday, October 18, 2013 9:06 AM > To: r-help@r-project.org > Subject: [R] Recovering object names when using the ... argument in a fn > > Hi all, > > I am using the ... argument to parmeter

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread Bert Gunter
That's because I screwed up! I gave you the wrong function, "f" instead of "g" . Here's g: g <- function(...){ sapply(as.list(match.call())[-1],deparse) } and the example should now work. Sheepishly, -Bert On Fri, Oct 18, 2013 at 10:21 AM, Dan Abner wrote: > Hi Bert, > > Thank you for the

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread Dan Abner
Hi Bert, Thank you for the code. However, I don't see what I am doing different, but my output is different. I would much rather have output similar to yours where only the input objects are returned (instead of the fn name, the encapsulating parentheses, etc.): > d1<-data.frame(x1=runif(100),x

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread Bert Gunter
1. Always cc to the list unless it is truly a private offlist reply. This is to get help from a wider audience, as may well be required here. Translation: Take my "solution" with a grain of salt. It is fragile at best. 2. I think ?match.call and ?deparse are what you're looking for: f <- function

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread Bert Gunter
I'm not exactly sure what you mean by "names." Does the following meet your needs? f <- function(...)names(list(...)) > f(a=2,b=3) [1] "a" "b" > f(a=2,3) [1] "a" "" If not, a reproducible example of what you want might be helpful. Cheers, Bert On Fri, Oct 18, 2013 at 9:05 AM, Dan Abner wro

[R] Recovering object names when using the ... argument in a fn XXXX

2013-10-18 Thread Dan Abner
Hi all, I am using the ... argument to parmeterize a user define fn to accept multiple input objects. I subsquently save all these data as a list. Question: what is the best way to recover or extract the original object names that were fed to the fn? Thanks, Dan [[alternative HTML versi