[[ I did discover yesterday (or maybe I was just reminded...) that we even have nonstandard nonstandard evaluation rules in some places (nls() seems to evaluate its model formula in the global environment even if it is given explicitly within a function:
f <- function() { g <- function(a,x) exp(-a*x) nls(y~g(a,x),start=list(a=.1)) } x <- 1:10 y <- exp(-.12*x)+rnorm(10,sd=.001) f() Error in eval(expr, envir, enclos) : couldn't find function "g"
Argh...]]
Given that I am, for better or worse, responsible for a large portion of the code in nls, I should make it clear that I did not understand the nonstandard evaluation rule in those days and so any nonstandrad nonstandrad rule used there is a bug. Now that I understand these things a little, I can see that nls does a few things wrong. I think the following patch mostly fixes them.
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-devel