[R] library()

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Dec 20 19:25:26 CET 2001


On Thu, 20 Dec 2001, Rolf Turner wrote:

>
> I've just installed version 1.4.0 of R, and am experiencing
> a puzzling phenomenon with the library() function.
>
> I have .lib.loc set as follows:
>
> > .lib.loc
> [1] "/usr/local/lib/R/library"      "/home/faculty/rolf/Rlib"
>
> If I invoke
>
> > library(melvin)
>
> I get the error message
>
>    Error in library(melvin) : There is no package called `melvin'
>
> but if I invoke
>
> > library(melvin,lib.loc="/home/faculty/rolf/Rlib")
>
> the package ``melvin'' gets loaded with no problems.
>
> What gives?  Is the .lib.loc object not being used in 1.4.0 the way
> it was used in 1.3.1?  (I can't see anything about this in the
> ``USER-VISIBLE CHANGES'' in Peter Dalgaard's posting to this list
> yesterday.)  Or have I done something silly?

There was a late change you will see down the list

    o   New function .libPaths() for getting or setting the paths to the
        library trees R knows about.  This is still stored in .lib.loc,
        which however should no longer be accessed directly.

so you might like to try that.

`USER-VISIBLE CHANGES' was an idea (of mine) to highlight import ones:
there may well be others. The person who changed this one obviously did
not think it important enough: the point is that .lib.loc from
package:base is used now, not one you set in the workspace.

Thanks for bringing this up: I was unaware of the change. It confirms that
the recommended way (set R_LIBS or use .libPaths()) should be adhered to!

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list