5.2 Installing R

If you are installing R on the same server as DHIS, you should consider using the Comprehensive R Archive Network (CRAN) to get the latest distribution of R. All you need to do is to add the following like to you /etc/apt/source.list file.

deb <your R mirror>/bin/linux/ubuntu <your Ubuntu distribution>

You will need to replace <your R mirror> with one from the list available here. You will also need to replace <your Ubuntu distribution> with the name of the distribution you are using.

Once you have done this, invoke the following commands

sudo apt-get update
gpg --keyserver pgp.mit.edu --recv-keys 51716619E084DAB9
gpg --armor --export 51716619E084DAB9 | apt-key add -
sudo apt-get install r-base r-cran-dbi

At this point, you should have a functional R installation on your machine.

Next, lets see if everything is working by simpling invoking R from the command line.

foo@bar:~$ R

R version 2.14.1 (2011-12-22)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.