[R] nesting environments

Antje niederlein-rstat at yahoo.de
Fri Aug 22 14:54:54 CEST 2008


Hello,

I got the hint to use nesting environments (for a GUI problem), but I'm not 
sure whether I understand what he means (and I did not really succeed with 
reading documentation - probably I looked for the wrong keywords?).
That's what he wrote:

 > Another good way to control the scoping is nesting environments (e.g. 
through closures). That is, your object does not need to be global (in the 
workspace) but it can be in a parent environment. In fact, global variables 
won't even work when you put your code into a namespaced pacakge, because the 
namespace will be locked.

Can anybody explain it (probably with a simple example)
That would be great!

Thanks,
Antje



More information about the R-help mailing list