Skip to content
Prev 12567 / 63461 Next

plot functions, formula interfaces and NAs

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.