[Rd] lm documentation, "formula" component (PR#1105)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
01 Oct 2001 15:21:46 +0200


david.firth@nuf.ox.ac.uk writes:

> Full_Name: David Firth
> Version: 1.3.1
> OS: linux and others
> Submission from: (NULL) (163.1.103.121)
> 
> 
> help(lm)
> 
> says that
> 
>   An object of class `"lm"' is a list containing at least the
>      following components:
> 
>   ...
> 
>   formula: the formula supplied.
> 
> 
> But is the "formula" component necessarily present?
> 
> An example:
> > x<-rnorm(10)
> > y<-rnorm(10)
> > temp<-lm(y~x)
> > names(temp)
>  [1] "coefficients"  "residuals"     "effects"       "rank"         
>  [5] "fitted.values" "assign"        "qr"            "df.residual"  
>  [9] "xlevels"       "call"          "terms"         "model"
> > temp$formula
> NULL

Nicely spotted. Yes, it's present:

> formula(temp)
y ~ x

However, it is part of the terms (and model) component, not a
component in itself (str(temp) to see it) so should probably not be
documented as such.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._