[R] Installing packages on Debian linux

Sebastian Luque sluque at mun.ca
Mon Oct 25 05:35:50 CEST 2004


Gorjanc Gregor wrote:

> same/similiar packaging system (dependencies, ...) as Debian. Is it wise
> to mix all three methods?

Mixing R CMD and install.packages() doesn't pose any problems, AFAIK, but
mixing any of them with apt-get does. The problem is that apt-get doesn't
know what you're doing with R CMD or install.packages() or remove.packages(),
so you may end up with duplicate packages (possibly in different places, see
below). I generally try to leave as much package management up to the system,
so I choose apt-get whenever possible. However, not all CRAN packages are
available from Debian yet, so you may end up having to use install.packages()
to install some packages.


> Which method is prefered for installation of R packages under Debian linux?
> - apt-get install R-package_name
> - install.packages('R-package_name')
> 
> I actually never tried with install.packages under linux. Where does it put
> the filesm under /usr/local or standard path?

install.packages() will use /usr/local/lib/R/site-library as default, but you
can change that with the lib argument. apt-get will put them
in /usr/lib/R/site-library.

I have a question to add myself though: is it still necessary to add a line
like:

deb http://cran.r-project.org/bin/linux/debian woody main

to /etc/apt/sources.list, as indicated in the CRAN mirrors? This might be
redundant, as a lot of packages are already available through the Debian
mirrors anyway, but I haven't checked how the list compares with the one in
CRAN.

Dirk? (Dirk Eddelbuettel is the maintainer of R Debian packages)

-- 
Best wishes,
Sebastian




More information about the R-help mailing list