[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-devel
Subject:    [Rd] na.action(lmObject) -> NULL instead of lmObject$na.action
From:       "William Dunlap" <wdunlap () tibco ! com>
Date:       2010-04-30 22:40:21
Message-ID: 77EB52C6DD32BA4D87471DCD70C8D70002DA5173 () NA-PA-VBE03 ! na ! tibco ! com
[Download RAW message or body]

I think the following three calls to na.action() should
return the same thing, but the last returns NULL.

  > d <- data.frame(x=c(1,2,NA,NA,5), y=log(1:5),
row.names=LETTERS[1:5])
  > na.action(na.exclude(d))
  C D
  3 4
  attr(,"class")
  [1] "exclude"
  > na.action(model.frame(y~x, data=d, na.action=na.exclude))
  C D
  3 4
  attr(,"class")
  [1] "exclude"
  > na.action(fit <- lm(y~x, data=d, na.action=na.exclude))
  NULL

lm() returns a list component called "na.action" while
na.exclude() and model.frame() return the same thing as
an attribute called "na.action".

  > fit$na.action
  C D
  3 4
  attr(,"class")
  [1] "exclude"

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic