From ripley at stats.ox.ac.uk  Mon Dec  1 08:26:54 2003
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon Dec  1 08:25:39 2003
Subject: [Rd] installing packages
In-Reply-To: <F0F4CB13-236F-11D8-BFCB-000A95A67E82@stat.ucla.edu>
Message-ID: <Pine.LNX.4.44.0312010715460.4150-100000@gannet.stats>

On Sun, 30 Nov 2003, Jan de Leeuw wrote:

> If R_LIBS is not set then R CMD INSTALL without a lib argument installs  
> in R_HOME/library
> while install.packages() without lib installs in the first element of  
> .libPaths().

which would normally be .Library=R_HOME/library, set in Rprofile.

> If R_LIBS is set, then R CMD INSTALL installs in the
> first directory in R_LIBS, and install.packages() still installs in the  
> first element
> of .libPaths() (i.e. ignores R_LIBS).

The first element of .libPaths() should be the first element of R_LIBS by 
default, set in Rprofile.

> Is this difference intentional ? It would perhaps be more convenient if
> .libPaths()[1] was used as a default in all cases (when no lib argument
> is given).

It is, provided the user has not reset .libPaths.

One caveat: R CMD INSTALL looks for R_LIBS in the environment, whereas by 
the time .libPaths() is set it can be set in other places, including via 
~/.Renviron.  Maybe R CMD INSTALL should look at more of those places.


-- 
Brian D. Ripley,                  ripley@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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] installing packages
Prof Brian Ripley