From hadley at rice.edu  Fri May 14 17:14:56 2010
From: hadley at rice.edu (Hadley Wickham)
Date: Fri, 14 May 2010 10:14:56 -0500
Subject: [Rd] Restrict access to variables in parent environment
In-Reply-To: <AANLkTilP5SFqjCrnvedxO5da-QHqxQxZpvU3QpETANUr@mail.gmail.com>
References: <AANLkTine-6pPbbOKspjOxOFF7qYC56KItUn_apBUKSgy@mail.gmail.com> 
	<AANLkTinVN5_uVkOaryuBnmw5JTYWdqWRojFRdG41hC-7@mail.gmail.com> 
	<AANLkTinyl2u3qXHjXcoBbWhBg8YaWlF917j_fEgj-hhO@mail.gmail.com> 
	<AANLkTilP5SFqjCrnvedxO5da-QHqxQxZpvU3QpETANUr@mail.gmail.com>
Message-ID: <AANLkTin1i_ZLnt3CHY0XfyVABZ2dhIN1Yjz4kQ4BxmMo@mail.gmail.com>

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/



[Rd] Restrict access to variables in parent environment
Hadley Wickham