The R programming language is one of the most powerful tools for data analysis on any operating system. There are two major parts of each install, the R-base that installs the programming language and its dependencies and R-Studio, which is an open-source IDE for R.
If you need help on installing R on Ubuntu 16.04 LTS, you can find that here.
Installing these in Windows is a snap but for Linux distros such as Ubuntu and Mint, they require a little command line finesse.
You can find R-Base in the Software Center; this would be the easy way to do it. However, the Software Center versions are often out of date, which can be a pain moving foward when your packages are based on the most current version of R Base. The easy fix is to download and install R Base directly from the Cran servers.
1. Add R repository
First, we’ve got to add a line to our /etc/apt/sources.list file. This can be accomplished with the following. Note the “trusty” in the line, indicating Ubuntu 14.04. If you have a different version, just change that.
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" | sudo tee -a /etc/apt/sources.list
2. Add R to Ubuntu Keyring
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
3. Install R-Base
Most Linux users should be familiar with the old…
sudo apt-get update sudo apt-get install r-base r-base-dev
Download the appropriate version of R-Studio here. From here you can download your files and install the IDE through Ubuntu Software Center or Synaptic Package Manager.
If you prefer a command line approach to install Rstudio:
sudo apt-get install gdebi-core wget https://download1.rstudio.org/rstudio-1.0.44-amd64.deb sudo gdebi -n rstudio-1.0.44-amd64.deb rm rstudio-1.0.44-amd64.deb