[R] ... and parameter checking

About this list Date view Thread view Subject view Author view

Jens Oehlschlägel-Akiyoshi (jens.oehlschlaegel-akiyoshi@mdfactory.de)
Fri, 17 Dec 1999 15:33:02 +0100



Hi,

when writing a wrapper function, I would like to be able to pass additional
arguments to more than one function inside, e.g.

  density.panel <- function(x, na.rm=TRUE, ...){
     usr <- par("usr")
     on.exit(par(usr))
     par(usr = c(usr[1:2], 0, 1) )
     lines( density(x, na.rm=na.rm, ...), ... )
  }

and then call it like

  density.panel(x, col="red", kernel="rectangular")

However, doing so generates an error from density (col=), which does not
allow ... and a warnings from plot.default(), which does not know about
kernel= .

Obviously I could patch density() to have a ... parameter and ignore
warnings from plot(), but, well ...

Can someone teach me how to solve this properly?

I cannot remember to have had such problems with S+, is this a difference
between R and S+ ?

Regards

--
Dr. Jens Oehlschlägel-Akiyoshi
MD FACTORY GmbH
Bayerstrasse 21

80335 München

Tel.: 089 545 28-27 Fax.: 089 545 28-10 http://www.mdfactory.de

Standard Disclaimers: Opinions expressed here are personal and are not otherwise represented.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b3 on Tue 04 Jan 2000 - 13:34:03 EST