[Rd] A problem with glm() and possibly model-using functions in general?

From: Byron Ellis <ellis_at_stat.harvard.edu>
Date: Fri 18 Nov 2005 - 22:46:34 GMT

So, consider the following:

> example(glm)
> g = function(model) { w = runif(9);glm(model,weights=w); }
> g(counts ~ outcome + treatment)
Error in eval(expr, envir, enclos) : object "w" not found

Huh?! I suspect that somebody is lazily evaluating arguments in the wrong environment (probably GlobalEnv in this case). I'm willing to accept the fact that there's some mysterious reason you'd actually want this behavior, but this looks like it should be filed as a bug to me.

Byron Ellis (ellis@stat.harvard.edu)
"Oook" -- The Librarian

R-devel@r-project.org mailing list
Received on Sat Nov 19 09:50:21 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:33 GMT