From tlumley at u.washington.edu  Thu Jun 19 08:46:11 2003
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Thu Jun 19 16:47:30 2003
Subject: [Rd] update.default bugfix (PR#3288)
In-Reply-To: <200306181714.h5IHEDJH019663@pubhealth.ku.dk>
Message-ID: <Pine.A41.4.44.0306190742330.326792-100000@homer01.u.washington.edu>

On Wed, 18 Jun 2003 minka@stat.cmu.edu wrote:

> According to the man page for formula, "a formula object has an associated
> environment".  However, update.default doesn't use this environment, which
> creates problems like the following:
>
>   make.model <- function(x) { lm(medv~.,x) }
>   library(MASS)
>   data(Boston)
>   fit = make.model(Boston)
>   fit = update(fit,".~.-crim")
>   # Object "x" not found

Update isn't going to satisfy everyone because people want it to do
incompatible things.  However, I don't think this is one of the things it
should be able to do.

In general the environment of a formula is used to look up variables in
the formula, not the data= argument.  (It's also used to look up the
weights= and subset= arguments, but that is a horrible wart that we would
like to excise).

	-thomas


[Rd] update.default bugfix (PR#3288)
Thomas Lumley