From ellis at stat.harvard.edu  Fri Nov 18 23:46:34 2005
From: ellis at stat.harvard.edu (Byron Ellis)
Date: Fri, 18 Nov 2005 14:46:34 -0800
Subject: [Rd] A problem with glm() and possibly model-using functions in
	general?
Message-ID: <1FB5B939-D81E-4CC6-9806-C4D1912581F7@stat.harvard.edu>

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 at stat.harvard.edu)
"Oook" -- The Librarian



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