Skip to content

na.action does not return na.action element of lm object

2 messages · Andrew Redd, Brian Ripley

#
I'm not sure if this is the official behavior but I would expect the
na.action function applied to a lm object to return the na.action.
Here is what I mean.
Warning message:
In x + rnorm(10) :
  longer object length is not a multiple of shorter object length
5
5
attr(,"class")
[1] "omit"
NULL

I would expect na.action(m) to return m$na.action.  This is simple
enough to fix with
na.action.lm<-function(object,...)object$na.action
but I would expect that this would already be included in the base.
Is there a reason that it is not?  I did a search through the archives
but did not turn up anything relevant.

Thanks,
Andrew Redd
#
Well, the na.action component (which may or may not be present in an lm 
object) is *not* what na.action is documented to give:

Value:

      The action which will be applied to 'object' whenever 'NA's are
      not desired.

So this needs some re-working, and it is not just "lm" objects that have 
the na.action information as a component and not an attribute.
On Mon, 25 Aug 2008, Andrew Redd wrote: