John Lande wrote: > Dear all, > > I am creating functions with the "three dot" strategy. I wold like to have > suggestion when writing multiple functions that calls multiple functions > with "...". > > I will give you a couple of example: > > >>a=1:5 >>b=6:10 >>d=3:7 > > >>example=function(x,y, z, ...){ > > plot(x,y, ...) > points(x,z, ...) > > } > > >>example(a,b,d) > > > how can I set different parameters for points and plot functions? for > example in plot I want to have bigger dots (lwd=3), while in the points I > want to have green dots. > > any suggestion? > Hi John, There are probably better solutions to this problem, but I usually add explicit arguments like this:
example<-function(x,y,z,y.lwd,z.col,...) { ... plot(x,y,lwd=y.lwd,...) points(x,z,col=z.col) ... } Jim ______________________________________________ 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.