Re: [Rd] Trying to understand the search path and namespaces

From: Hadley Wickham <hadley_at_rice.edu>
Date: Mon, 15 Nov 2010 19:45:30 -0600

> 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/

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue 16 Nov 2010 - 01:48:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 16 Nov 2010 - 08:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive