[R] nesting environments

Antje
Fri, 22 Aug 2008 12:54:54 -0000

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