« Cloud based GIS server | Main | Load R packages »

March 07, 2011

Install R Statistical Package

Documentation of a process.

Step-by-step instructions from a kindred soul.

Official instructions from the R Project.

More official instructions.

1. Open a terminal
2. Add a gpg (pgp?) key to authenticate downloads from R.
- What is a gpg key?

$ gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
$ gpg -a --export E084DAB9 | sudo apt-key add -

- The GPG key may change occasionally. The most up to date key can be found in the SECURE APT section of this page.

3. Add a mirror site from which to download R-related code to sources.list

$ sudo gedit /etc/apt/source.list

Add this line to the bottom:
deb http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu lucid/

Note: A list of mirrors is available.
Note: See the INSTALLATION first section of this page for more on setting up a mirror.

4. Install the R code
$ sudo apt-get install r-base

Note: This tutorial mentions additional commands and build-essential at steps 7 & 8 but the above command appears to install that code.

5. Start and Update R

$ sudo R
> update.packages()

Potentially helpful comment:

I also like 'sudo apt-get install littler' and I then copy or link
install.r to /usr/local/bin and just use

$ sudo install.r foo far fie foo

which would then install the (hyopthetical) packages foo, far, fie and foo
from CRAN.

6. Install and Open the R Commander GUI

$ R
> library(Rcmdr)
Loads packages
> Commander()

7. File Location Notes

/usr/share/R for architecture-independent files.

Downloaded Packages go here:
-- 'base R' and recommended packages are in /usr/lib/R/library/
-- Debian-packaged R packages are in /usr/lib/R/site-library/
-- packages installed by you / R are in /usr/local/lib/R/site-library/

Posted by kkwaiser at March 7, 2011 10:01 AM


Login to leave a comment. Create a new account.