Re: [R] How to output name of object

2014-06-18 Thread Bert Gunter
Ah, yes. Much better -- that is what match.call() is for. As always, thanks for the insight, Best, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Wed, Jun 18

Re: [R] How to output name of object

2014-06-18 Thread Prof Brian Ripley
On 18/06/2014 15:01, Bert Gunter wrote: Would f <- function (...) { sapply(substitute(list(...)),deparse)[-1] } f(a1=log(1:4), m1=1:4, c1=pi) a1 m1 c1 "log(1:4)" "1:4" "pi" be equivalent? I find the substitute(...()) construction completely mysterious,

Re: [R] How to output name of object

2014-06-18 Thread Bert Gunter
Would f <- function (...) { sapply(substitute(list(...)),deparse)[-1] } > f(a1=log(1:4), m1=1:4, c1=pi) a1 m1 c1 "log(1:4)" "1:4" "pi" be equivalent? I find the substitute(...()) construction completely mysterious, while substitute(list(...)) makes sense to m

Re: [R] How to output name of object

2014-06-18 Thread Prof Brian Ripley
On 18/06/2014 12:54, Jim Lemon wrote: On Wed, 18 Jun 2014 04:24:58 PM yzh lin wrote: Hi, every R user, I wanna output names of objects, I googled codes from website, but it was not what I wanted. the codes are as following: f <- function (...) { unevaluatedArgs <- substitute(...())

Re: [R] How to output name of object

2014-06-18 Thread Jim Lemon
On Wed, 18 Jun 2014 04:24:58 PM yzh lin wrote: > Hi, every R user, > >I wanna output names of objects, I googled codes from website, but it > was not what I wanted. > > the codes are as following: > > f <- function (...) > { > unevaluatedArgs <- substitute(...()) > evaluatedArgs <- lis

[R] How to output name of object

2014-06-18 Thread yzh lin
Hi, every R user, I wanna output names of objects, I googled codes from website, but it was not what I wanted. the codes are as following: f <- function (...) { unevaluatedArgs <- substitute(...()) evaluatedArgs <- list(...) stopifnot(length(unevaluatedArgs) == length(evaluatedArgs))