[Rd] Restrict access to variables in parent environment

Hadley Wickham hadley at rice.edu
Fri May 14 17:14:56 CEST 2010


On Fri, May 14, 2010 at 10:10 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> You can get around that by using this instead:
>
> environment(f) <- as.environment(2)
>
> provided it is done after you have loaded all your packages.

Another approach is to inspect function by function:

library(codetools)
findGlobals(f, F)$variables

Hadley
-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-devel mailing list