Skip to content
Prev 190848 / 398498 Next

eval and evironments: call local function in a global function

Certainly its possible to dynamically write to the package's namespace.
For example, lattice does that. It stores various lattice options there.

Injecting setVar is not really more conservative though.   Consider that
when you modify the environment of a function in main:

environment(fun.global) <- environment()

you are actually modifying a copy of fun.global and the original fun.global
is not changed at all so you are not disturbing any external objects whereas
injecting setVar and setting it back again actually modifies the environment
external to main.
On Fri, Aug 21, 2009 at 7:20 AM, Renaud Gaujoux<renaud at cbio.uct.ac.za> wrote: