[Rd] plot functions, formula interfaces and NAs
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon May 3 15:30:00 CEST 2004
As we have seen from PR#6846, we don't document much what happens to NAs
in plot functions. The formula interfaces do seem to be a bit of a mess,
as they call model.frame and so some (but only some) of them pick up the
options() setting of na.action. This means that for example
pairs(~ x +y + z) and pairs(cbind(x, y, z))
may well treat NAs differently, depending on the value of
getOption("na.action").
However, the formula methods for plot, lines and points do ignore
getOption("na.action") and use na.action=NULL (or equivalently, na.pass).
I believe no function should be using getOption("na.action") without a
means to override it, and thus the formula methods of
boxplot, mosaicplot and pairs
should get an na.action argument. Further, since in all cases the
non-formula methods do handle missing values, I think the default should
be na.pass. That is a change in behaviour, but the existing behaviour is
undocumented.
The proposal is to document this for 1.9.1 and change it for 2.0.0.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-devel
mailing list