Re: [R] dots and substitute

2008-04-06 Thread Simon Anders
Hi Charles, Charles C. Berry wrote: > Try this: > > f2 <- function(...) sapply( substitute(list(...)), deparse )[-1] Wow, this works. Thanks a lot! > p.s. Why do you want this as mode "character"? For the usual purpose of 'substitute': to label something. The use case is that I have a

Re: [R] dots and substitute

2008-04-06 Thread Charles C. Berry
On Sun, 6 Apr 2008, Simon Anders wrote: > Hi, > > is there an elegant way to use 'substitute' with '...' arguments? > > My first try was this: > > > f1 <- function(...) substitute(...) > > f1( 2+7, "foo", 3+5 ) > 2 + 7 > > As you can see, substitute acts only on the first argument. So I tried > >

[R] dots and substitute

2008-04-06 Thread Simon Anders
Hi, is there an elegant way to use 'substitute' with '...' arguments? My first try was this: > f1 <- function(...) substitute(...) > f1( 2+7, "foo", 3+5 ) 2 + 7 As you can see, substitute acts only on the first argument. So I tried > f2 <- function(...) substitute(list(...)) > f2( 2+7, "f