From astoddar at mail.med.upenn.edu  Fri May  6 18:45:03 2005
From: astoddar at mail.med.upenn.edu (Alexander Stoddard)
Date: Fri May  6 18:49:41 2005
Subject: [Rd] How to understand packages, namespaces, environments
Message-ID: <f3ed5b562d661ead695a58d506e52e02@mail.med.upenn.edu>

I would be very glad of pointers to information on how the concepts of 
packages, namespaces and environments are interrelated in R.

I am trying to get a handle on this both so I can delve further into 
understanding other people's code and so I can organize my own in a 
more coherent manner.

 From my reading about environments it seems they function as what I 
would intuitively call namespaces. However, the documentation for the 
'library' function implies that "namespace" has a specific meaning in R 
that I have so far failed to grasp. What is that meaning (or where 
should I look to read up on it) ?

I can think of the following more specific questions. Perhaps they may 
most usefully serve to reveal my misconceptions, so corrections would 
be very helpful.

Does saying the following load package 'foo' into its own environment ?
 > library(foo)

Do environments have names?

Of what does the list returned by search() actually consist? Is it a 
list of environments, a list that may include environments, or 
something else?

What is actually designated by a character vector of form "package:foo"?

In what ways can I use the character vector "package:foo" when 
interacting with R?

Many thanks,
Alex Stoddard

P.S. It took me a long time of flailing about to discover the 'search' 
function. Perhaps it could be included in the "See Also" section of the 
help for 'ls'.


[Rd] How to understand packages, namespaces, environments
Alexander Stoddard