R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS.
One of my main motivations to install R is Sweave. The Sweave is a literate programming language which integrates LaTeX and R code. The main idea of the Sweave is to combine data analysis code and standard formatted text into a single document.
The Ubuntu CRAN (The Comprehensive R Archive Network) packages have been signed with a new pgp key. The Ubuntu archives on CRAN are signed with the key of “Michael Rutter
$ sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Open your sources.list file in gedit
$ sudo gedit /etc/apt/sources.list
and add the following line (using http://cran.rstudio.com/ mirror) at the end of the file:
deb http://cran.rstudio.com/bin/linux/ubuntu/ precise/
(You can go to http://cran.r-project.org/mirrors.html for the list of CRAN mirrors and replace the current URL mirror with your favorite one)
To install the complete R system, use
$ sudo apt-get update
$ sudo apt-get install r-base
if you need to compile R packages from source, also install the r-base-dev package:
$ sudo apt-get install r-base-dev