[R] Scope change in R1.2?

Jari Oksanen jhoksane at ecology.helsinki.fi
Mon Dec 18 13:44:51 CET 2000

I upgraded R-base 1.2.0 today, and then I intended to give a finishing touch 
to some R functions I should send out today. To my surprise, they failed in R 
1.2 although they still worked fine in R 1.0.1 (I checked in another machine). 
The error message I got was like this:

> optci(trar.g, water)
Error in unique(c("AsIs", class(x))) : Object "x" not found

The function call was 

> optci <- function (model, x, confidence = 0.95)

where "model" is a glm object and "x" is a variable, in this case "water" (not 
a very unique name, though). It seems that "x=water" is passed OK as a 
variable, but the error comes when I try pass "x" to another function within 
"optci". This function calls still another function, and, now it comes, this 
calls update.formula. It seems that the error comes after this update. I see 
that the update.formula has changed between 1.0.1 and 1.2.0 and update is 
defines explicitly the environment as the environment of the original glm 
which in this case is <environment: R_GlobalEnv>, and I try to update the 
formula with a variable defined within local scope. Is this a likely 
explanation, and if so, is there a road ahead or should I just give up? At 
least I cannot trace this problem any longer, since update.formula is the last 
R code I see. It then vanishes into update which is non-transparent to me. 
update.formula seems to work OK, but the error message seems to come from 

Sorry for the trouble, and thankful for any help.

cheers, jari oksanen
Jari Oksanen - Dept Ecol Env Sci, Univ Helsinki, 15140 Lahti
Ph. +358 3 89220312, Fax -- 89220289, Mobile +358 40 5136529
jari.oksanen at helsinki.fi    http://www.helsinki.fi/~jhoksane

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list