From sfalcon at fhcrc.org  Mon Oct 23 06:05:18 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Sun, 22 Oct 2006 21:05:18 -0700
Subject: [Rd] Getting hold of a package's environment from C code
In-Reply-To: <eb555e660610221424kac664fanba7b998b12faaf1e@mail.gmail.com>
	(Deepayan Sarkar's message of "Sun, 22 Oct 2006 14:24:51 -0700")
References: <eb555e660610221256g3952a408sc25f06afe8307cb5@mail.gmail.com>
	<453BD456.4050702@stats.uwo.ca>
	<eb555e660610221424kac664fanba7b998b12faaf1e@mail.gmail.com>
Message-ID: <m2ac3n3ce9.fsf@ziti.fhcrc.org>

"Deepayan Sarkar" <deepayan.sarkar at gmail.com> writes:

> On 10/22/06, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>> In R code, you could use getNamespace("pkg") to get the namespace
>> environment.  I haven't tried this, but I'd assume
>>
>> PROTECT(rho = eval(lang2(install("getNamespace"),
>>                           ScalarString(mkChar("pkg"))));
>>
>> (or something like it) would be the C equivalent.

Perhaps:

R_FindNamespace(mkString(where))


+ seth




[Rd] Getting hold of a package's environment from C code
Seth Falcon