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:

  1. 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
    
  2. Add the CRAN repository to the end of /etc/apt/sources.list:
       deb https://cran.cnr.berkeley.edu/bin/linux/ubuntu trusty/
    
  3. Install R as follows:
      sudo apt-get update
      sudo apt-get install r-base r-base-dev
    

This will install R and the recommended ...

Get Apache Spark for Data Science Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.