Steps to install R in ubuntu from command line:
- add the following configuration in /etc/apt/sources.list file
# configuration for R
deb http://cran.nexr.com/bin/linux/ubuntu precise/
- Command: sudo apt-get update
- Command: sudo apt-get install r-base
- Command to start R: R
- Command to quit R: q()
NOTE:
1) Step-1 is dependent on the version of ubuntu. You can find the ubuntu version using the following command:
lsb_release -a
2) You can also different mirror site for step-1. The list is available
here.
3) You may need to use secure apt. In that case, just after step-1 (before step-2), run the following commands:
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
Reference: http://cran.r-project.org/bin/linux/ubuntu/README