programfunction(dataset) { tmp<-glm(weta~1, family=poisson, data=dataset) tmp.f<-step(tmp,~.+jd) }
When I run program(data) in 1.9.0, an error message appears:
Error in model.frame.default(formula = WETA ~ jd, data = dataset, drop.unused.levels = TRUE) : Object "dataset" not found
Yes, it looks as though add1.glm is not putting the environment information in the same place that model.frame.glm is looking for it.
add1.glm sets up an empty shell of a glm object and calls model.frame.glm, but model.frame.glm uses the $terms component to specify the environment, and add1.glm doesn't give a $terms component. Presumably at some time in the past model.frame.glm used the $call$formula component instead.
-thomas
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html