Hello, I am a (relatively) experienced programmer, but new to R.
I have a problem using R 1.9.1. I have fit some data using glm(), from within a function: formula = as.formula(paste(depvarname, "~", rhs), env=globalenv()) return (glm(formula, family=binomial(link=logit))) I have now come back to the formula and want to add some more variables to it. So I do: expand.model.frame(formulaname, ~ new_variable) but I get the response Error in eval(expr, envir, enclos) : Object "foreignaid.dummy" not found where foreignaid.dummy is my dependent variable. However, foreignaid.dummy is clearly visible in the global environment: > ls(pat="foreignaid.dummy", envir=globalenv()) [1] "foreignaid.dummy" ... So why is my dependent variable lost? I have read the earlier comments on the same topic, but they seem to indicate that a previous bug was fixed. Am I missing the point about scoping? Any help much appreciated. David Hugh-Jones Essex University Govt Dept ______________________________________________ [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