Installing and Updating R

19 07 2009

These are the recommendations from CRAN on how to install and update R. I have streamlined it for my situtation.

To obtain the latest R packages, add an entry like
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu hardy/
in your /etc/apt/sources.list file.

In my case (using Ubuntu Hardy 8.04 LTS in Bergen, Norway) this is
deb http://cran.ii.uib.no/bin/linux/ubuntu hardy/

See http://cran.r-project.org/mirrors.html
for the list of CRAN mirrors.

To install the complete R system, use
sudo aptitude update
sudo aptitude install r-recommended ess

ESS is a package to use R via the emacs editor. It is good! As an added convenience to Ubuntu users it is provided as an up-to-date version in the cran repositories.

SECURE APT

The Ubuntu archives on CRAN are signed with the key of “Vincent Goulet
<vincent.goulet@act.ulaval.ca>” with key ID E2A11821. You can fetch
this key with

gpg --keyserver subkeys.pgp.net --recv-key E2A11821

and then feed it to apt-key with
gpg -a --export E2A11821 | sudo apt-key add -

ADMINISTRATION AND MAINTENANCE OF R PACKAGES

The R packages part of the Ubuntu r-base and r-recommended packages
are installed into the directory /usr/lib/R/library. These can be
updated using aptitude with

sudo aptitude update
sudo aptitude upgrade

The other r-cran-* packages shipped with Ubuntu are installed into the
directory /usr/lib/R/site-library.

Installing R packages not provided with Ubuntu first requires tools to
compile the packages from source. These tools are installed via the R
development package with
sudo aptitude install r-base-dev

Then a site administrator can install R packages into the directory
/usr/local/lib/R/site-library by running R as root and using the install.packages() function:
sudo R
install.packages()

A routine update can then be undertaken from R using
update.packages(lib.loc = "/usr/local/lib/R/site-library")

About these ads

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: