[R] Manipulating the "..." args.

S Ellison S.Ellison at lgc.co.uk
Fri Feb 1 12:37:54 CET 2008


I'm no guru, but can you not use do.call here?

i.e. does

foo<-function(...) #Not x(...)
{  
   arglist<-list(...)
   #remove bad characters from arglist here.
   
   # then
   do.call("bar",arglist)

}

do what you want?

>>> "David Keegan" <david.keegan at shenick.com> 01/02/2008 11:00:15 >>>
Hi,

foo<-x(...)
{  # Need to remove bad characters from string arguments "..."
   # here.

   # Pass on the modified string arguments.
   bar(...)
}

I need to modify string arguments passed in to function foo
as "..." and then pass the modified arguments on to function
bar. Is there a way to access the contents of "..." for
in-place modification?

I know I can use args <- list(...), but presumably that
takes a copy. Unless there is a way to pass the list
as "..." in the call to bar?

Regards,
David.
-- 
[David Keegan david.keegan at shenick.com 353 1 2710818]

______________________________________________
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.

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list