[R] what can one do with (to) '..." ?

Carl Witthoft carl at witthoft.com
Tue Aug 16 12:28:12 CEST 2011


Sorry - I wanted to dig a bit deeper than that.  I certainly appreciate 
your point, as well as the other recent responses, but what I'm trying 
to figure out is:  what does the last function called do to interpret 
the "..." ?  Suppose I have:


foo<-function(x,y,...){
z <-x+y
plot(z,...)
}

I am fully comfortable with that sort of use.  But,  what does plot (or 
its internal calls) use for code to turn the contents of "..." into 
local named arguments?  Is it something like

arg.dot<-list(...)
if ( some_match_func("foo", names(arg.dot) ) foo<-arg.dot$foo   else 
foo<- default_value

?
Or are there better constructs?

thanks again for all info, and for your patience with me :-)

Carl


On 8/15/11 9:40 PM, Comcast wrote:
> Inside your function that has a ... argument, you can get the optional arguments with :
>
> Arg.dot<- list(...)
>
> Section 2.1.5 of the R Language Definition which should be accessible from the help facility would appear to be sensible place to start. "Programming for Data Analysis" could also be purchased.

-- 
-----
Sent from my Cray XK6



More information about the R-help mailing list