Skip to content
Prev 10951 / 398502 Next

Self-starting nls functions

On Sun, 29 Apr 2001, Philippe Grosjean wrote:

            
All functions in R have an environment.  It is only printed if it is not
the global environment, aka the user workspace.  The environment is use in
lexical scoping: see the FAQ.  Normally functions in packages are not
lexically scoped (their environment is made the global environment), so you
rarely see this.  Note that in this case it is the attribute function that
has a non-default environment, not SSlogis itself, and you can find out
what is in it (and hence what it is) by

ls(envir = environment(attr(SSlogis, "initial")))

I rather suspect this is a mistake and the environment should
have been reset to the global environment as with the function itself.