Installing R
In this recipe, we will see how to install R on Linux.
Getting ready…
To step through this recipe, you need Ubuntu 14.04 (Linux flavor) installed on the machine.
How to do it…
Here are the steps in the installation of R:
- The Comprehensive R Archive Network (CRAN) contains precompiled binary distributions of the base system and contributed packages. It also contains source code for all the platforms. Add the security key as follows:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
- Add the CRAN repository to the end of
/etc/apt/sources.list
:deb https://cran.cnr.berkeley.edu/bin/linux/ubuntu trusty/
- Install R as follows:
sudo apt-get update sudo apt-get install r-base r-base-dev
This will install R and the recommended packages, and additional packages can be installed using install.packages("<package>")
. The packages on CRAN are updated on a regular basis and the most recent versions will usually be available...