[R-sig-Debian] r-cran-vars?

Dirk Eddelbuettel edd at debian.org
Tue Oct 28 01:53:36 CET 2008

On 27 October 2008 at 14:48, Christopher David Desjardins wrote:
| You could use install.packages().  What I usually do is download the
| tarball of interest from CRAN and as root run 
| R CMD INSTALL foo.tar.gz

Correct, even though you have the manual download. And if you do 'sudo
apt-get install litter' you get r with examples below /usr/share.

So I usuall just do

   $ sudo install.r foo

which finds, downloads and installs foo from CRAN.  I set my default repo in

Likewise we also have update.r in littler.  You need to copy, link or alias
these from /usr/share/doc/littler/examples to somewhere in your path,
e.g. ~/bin (which you'd need to add to $PATH) or /usr/local/bin.
| This will by default install to /usr/local/lib/R/site-library
| Then you can call it in R with library(foo)
| I believe you can specify where you want to install it to with the -l
| option.  ?Install for more details.


| On Mon, 2008-10-27 at 20:28 +0100, Arnaud Battistella wrote:
| > Hi,
| > I was wondering what is the recommended way to install the "vars" package in
| > debian. And for that matter, how do you usually install R packages not
| > included in debian? I guess I could simply use install.packages() but I'm
| > afraid of ending up with several versions of the same package which could be
| > bad I guess...

Years ago we made the choice set for you at the end of /etc/R/Renviron :  by
having R_LIBS_SITE point to three different directories, we can separate

- R's recommended packages via r-cran-* in /usr/lib/R/library 
- Other R packages installed via Debian's r-cran-* in /usr/lib/R/site-library
- Everything else via install.packages() into /usr/local/lib/R/site-library

You can still add more for campus-wide package, personal libraries, ... in
other directories if you wish, but you can also 'just use' this
defaults. Works for most of us :)


Three out of two people have difficulties with fractions.

More information about the R-SIG-Debian mailing list