On 11-08-16 6:28 AM, Carl Witthoft wrote:
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:
The best source for this (but it's not easy) is to look at the R
sources. "..." is called R_DotsSymbol there. Most of the important
handling happens in https://svn.r-project.org/R/trunk/src/main/eval.c,
but it also shows up in a number of other places.
Duncan Murdoch
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.
______________________________________________
R-help@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.