From hadley at rice.edu  Tue Nov 16 02:45:30 2010
From: hadley at rice.edu (Hadley Wickham)
Date: Mon, 15 Nov 2010 19:45:30 -0600
Subject: [Rd] Trying to understand the search path and namespaces
In-Reply-To: <4CE1DE06.9060809@fhcrc.org>
References: <AANLkTin090pRti8dXknLKtpFmUmmvRsAz6a0V2mx5iOM@mail.gmail.com>
	<AANLkTi=3K0T7qzQnRU-Q8h3RVTDS+UQ5CmcOs4xZJYfD@mail.gmail.com>
	<AANLkTikPE5acZ6CKJeoq9RpphUJffr4W8Lm_8c7O7i08@mail.gmail.com>
	<AANLkTimckaNaUb6SjY=njVZuRSa1iJ+4entWVA2ghBxD@mail.gmail.com>
	<4CE1DE06.9060809@fhcrc.org>
Message-ID: <AANLkTi=BsP2mE8avreNMBx_P-ORcEhRB_mK0-k8fFTpq@mail.gmail.com>

> 1.6 of Writing R Extensions says
>
> Note that adding a name space to a package changes the search strategy.
> The package name space comes first in the search, then the imports, then
> the base name space and then the normal search path.
>
> I'm not sure of the details, but I think
>
> ?parents(getNamespace("devtools"))

Ah, my mistake was assuming that the package namespace and environment
were the same thing.

Interestingly the namespace is dynamic:

> parents(getNamespace("devtools"))
...
[31] "base"
> library(roxygen)
> parents(getNamespace("devtools"))
...
[31] "Autoloads"            "base"

Hadley

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



[Rd] Trying to understand the search path and namespaces
Hadley Wickham