[Rd] expand.model.frame() fails when subset is specified (PR#979)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
14 Jun 2001 20:54:31 +0200


gregory_r_warnes@groton.pfizer.com writes:

> Full_Name: Gregory R. Warnes
> Version: 1.2.0, 1.2.3
> OS: SunOS gsun124 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-5_10
> Submission from: (NULL) (12.18.36.49)
> 
> 
> When using expand.model.frame on a model that specifies a subset selection, 
> an error is generated on the variable used for the subset selection.  
> 
> Example:
> 
> > data <- data.frame(x=1:10,y=1:10,z=1:10,m=1:10)
> > model <- lm( y ~ x, data=data, subset=m<8)
> > expand.model.frame(model, ~ z)
> Error in [.data.frame(structure(list(y = c(1, 2, 3, 4, 5, 6, 7, 8, 9,  : 
>         Object "m" not found
> 

Thanks. This is also present in the current pre-1.3.0. Your patch
looks correct, but I wonder if the default for "enclos" should not be
environment(formula(model)) rather than parent.frame() as it is now?

(And wouldn't it be better named "envir"?)

-- 
   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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._