[R] library() and lib.loc

r-help@lists.thewrittenword.com r-help at lists.thewrittenword.com
Fri Sep 28 14:08:37 CEST 2001


On Fri, Sep 28, 2001 at 08:03:29AM +0100, Prof Brian D Ripley wrote:
> On Thu, 27 Sep 2001 r-help at lists.thewrittenword.com wrote:
> 
> (Really albert chin (china at thewrittenword.com): please sort out your
> mailer so that mail gets sent back to you not redirected to the list!)

I set Reply-To: so the list would get the reply.

> > library() takes lib.loc as the third argument. Where is this set? I am
> > modifying the default library search path and everything seems to be
> > ok except for this (I want R_HOME/lib/library rather than
> > R_HOME/library).
> 
> Well, it isn't set, it is supplied by the user of library(), so just use
> 
> library(foo, lib.loc=file.path(Rhome(), "lib", "library"))
> 
> However, it defaults to .lib.loc, and that is set in the system Rprofile,
> R_HOME/library/base/R/Rprofile.  The recommended way to change that is to
> set R_LIBS before calling R, e.g. in your .Renviron.

We modified src/library/profile/Rprofile.unix and changed the default
location to:
  .Library <- file.path(R.home(), "lib", "library")

> You can't get away with changing the main library from R_HOME/library,
> as that is hardcoded in several places.

Actually, we've changed the default. Tthe default directory hierarchy
install used by R does not agree with how we build our other packages.
Everything appears to be working OK.

Thanks for the help.

-- 
albert chin (china at thewrittenword.com)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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