[Rd] Re: Packages and Libraries (was: Re: lme4 "package" etc

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Wed Feb 9 00:02:53 CET 2005


On Tue, 08 Feb 2005 22:19:46 -0000 (GMT) (Ted Harding) wrote:

> On 08-Feb-05 Kurt Hornik wrote:
> > Afaic, one of the issues is that it seems common practice to refer
> > to collections of code as "libraries" or "packages", and we're
> > trying to use these rather general-purpose terms in a very precise
> > meaning, and obviously not very successful, in particular because
> > the use of"library" is highly non-standard.  One idea might be to
> > replace the"library" by something else like ... "a place where R
> > knows where to find packages" ... hmm, now that's too long, so ...
> 
> The only issue I have with "library" vs "package" (or vice versa)
> is the following.
> 
> I *know* that a collection of functions etc. (such as nlme) is
> properly called a "package". I could (and do) get ticked off if
> I refer to it as a "library".
> 
> However, if I want to use it then I enter
> 
>   library(nlme)
> 
> As a result, the little daemons who potter around re-wiring
> my mental circuits sometimes cross-connect these two. As a
> result, I can inadvertently refer to "the nlme library".
> 
> An example is a recent mailing of mine to the list where
> I twice referred to a certain "library" (and was amiably
> rebuked by Martic Maechler) -- but then I saw that I had
> also twice referred to the same "package" in the same mail!
> 
> Personally I don't mind whether it is called "package" or
> "library", though using the command library() to load a
> package does tend, as described, to get me treading on my
> own shoelaces.
> 
> But, a propos, is there an R entity called a "library"
> (other than the command) as distinct from a "package"?

A *library* is a directory in which you can find R *packages* (just as
in real life you can find books in a library) and with 
  library("foo", lib.loc = "/path/to/bar")
you want to get the package (book) "foo" from the library "bar" located
at "/path/to/bar".

So the two are really distinct...in real life, you also wouldn't say
that you have been in the book where they had a lot of libraries on the
shelves, would you? ;-)

But as Kurt explained: this distinction between "library" and "package"
is specific to R and does not correspond to common practice for other
software systems.
Z

> If so, then I can accept the necessity for disciplined
> distinction between them, since calling one sort of thing
> by the name of another sort of thing necessarily creates
> confusion. But if not, then I'm inclined to feel that
> a bit of loose talk is acceptable (since then a reference
> to a "library" would be understood as a reference to a
> "package", since what else would it be?)
> 
> Just my thoughts ...
> 
> Ted.
> 
> 
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 08-Feb-05                                       Time: 22:19:46
> ------------------------------ XFMail ------------------------------
> 
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



More information about the R-devel mailing list