[R] Deparsing '...'

2006-03-02 Thread Matthew Dowle
Hi, The following function works, but is there a neater way to write it? f = function(x,...) { # return a character vector of the arguments passed in after 'x' gsub( ,,unlist(strsplit(deparse(substitute(list(...))),[(,)])))[-1] } f(x,a,b,c*d) [1] a b c*d Thanks.

Re: [R] Deparsing '...'

2006-03-02 Thread Peter Dalgaard
Matthew Dowle [EMAIL PROTECTED] writes: Hi, The following function works, but is there a neater way to write it? f = function(x,...) { # return a character vector of the arguments passed in after 'x' gsub( ,,unlist(strsplit(deparse(substitute(list(...))),[(,)])))[-1] }

Re: [R] Deparsing '...'

2006-03-02 Thread Matthew Dowle
That's much neater, thanks. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard Sent: 02 March 2006 16:59 To: Matthew Dowle Cc: 'r-help@stat.math.ethz.ch' Subject: Re: [R] Deparsing '...' Matthew Dowle [EMAIL PROTECTED] writes

Re: [R] Deparsing '...'

2006-03-02 Thread Prof Brian Ripley
f - function(...) as.character(match.call())[-1] f(x,a,b,c*d) [1] x a b c * d On Thu, 2 Mar 2006, Matthew Dowle wrote: Hi, The following function works, but is there a neater way to write it? f = function(x,...) { # return a character vector of the arguments passed in

Re: [R] Deparsing '...'

2006-03-02 Thread Matthew Dowle
(...) g(x,a,b,c) [1] ..1 ..2 ..3 -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 02 March 2006 17:18 To: Matthew Dowle Cc: 'r-help@stat.math.ethz.ch' Subject: Re: [R] Deparsing '...' f - function(...) as.character(match.call())[-1] f(x,a,b,c*d) [1] x

Re: [R] Deparsing '...'

2006-03-02 Thread Peter Dalgaard
, a, b, c) -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 02 March 2006 17:18 To: Matthew Dowle Cc: 'r-help@stat.math.ethz.ch' Subject: Re: [R] Deparsing '...' f - function(...) as.character(match.call())[-1] f(x,a,b,c*d) [1] x

Re: [R] Deparsing '...'

2006-03-02 Thread Matthew Dowle
: 02 March 2006 18:07 To: Matthew Dowle Cc: 'Prof Brian Ripley'; 'r-help@stat.math.ethz.ch' Subject: Re: [R] Deparsing '...' Matthew Dowle [EMAIL PROTECTED] writes: That's even neater. But when its called from within another function, this happens, see below. I was planning to call f

Re: [R] Deparsing '...'

2006-03-02 Thread Gabor Grothendieck
Sent: 02 March 2006 18:07 To: Matthew Dowle Cc: 'Prof Brian Ripley'; 'r-help@stat.math.ethz.ch' Subject: Re: [R] Deparsing '...' Matthew Dowle [EMAIL PROTECTED] writes: That's even neater. But when its called from within another function, this happens, see below. I was planning