Skip to content
Prev 8271 / 398506 Next

Step function

On Wed, 29 Nov 2000, Matt Pocernich wrote:

            
This is a bug, I think.  The problem is that the data frame is called
x. If it were called something else there wouldn't be a problem, so the
workaround is to change the name of your data frame.


Looking at traceback() the problem is that the data frame `x' is being
searched for in the environment of add1.lm by model.frame.lm().  In most
cases it doesn't find it there and goes back to the global environment,
but if the data frame is called `x' (or one of 17 other things) it finds
the wrong thing in environment(add1.lm).

In R1.1.1 I'm not sure what can be done about this -- model.frame.lm
doesn't know where to find `x' and there isn't a general solution.  In
R1.2 we have more information and should be able to look in
environment(formula(lmobject)), but we aren't doing that yet.

	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._