R is the most popular programming language in the field of Big data analysis and data science. Python is also there on the other hand but R has a much bigger library for statistical packages. And also R builds in data analysis functionality by default, whereas Python relies on packages. So the most preferred language for data analysis is R.
So in my today’s blog post am going to demonstrate how you can download R and R studio which is an IDE meant for faster R development on Ubuntu. Below are the steps that you should follow in order to get R and R studio on your machine.
So let’s get started…
Steps :
1. Open the terminal on your machine.
2. Add a key to APT for authentication of packages that we are going to download in some next steps. Enter below command and hit enter.
sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys E084DAB9
3. Then add the repository URL to APT.
sudo add-apt-repository 'deb https://ftp.ussg.iu.edu/CRAN/bin/linux/ubuntu xenial/'
4. Then update the package list.
sudo apt-get update
5. Then install r-base package which is the default base package for R programming language.
sudo apt-get install r-base
6. Then r-base development package.
sudo apt-get install r-base-dev
Now at this moment, you have install R on your machine. You can use R by typing R on the terminal and hitting enter. After you do that you will be prompted to R shell on which you can type one by one command and use it.
In case you want to use R studio which an exclusive IDE for R you have to follow below additional steps.
Steps :
1. Install gdebi core package.
sudo apt-get install gdebi-core
2. Then download the latest version of R studio
wget https://download2.rstudio.org/rstudio-server-1.1.442-amd64.deb
3. Then install JPEG runtime library
sudo apt install libjpeg62
4. NOTE – If your Ubuntu version is between 16.10 to 17.04 then you have to install some additional packages on your machine. And if your Ubuntu version is above 17.04 then you can proceed to step 8.
5. Download the libgstreamer packages and install them.
wget http://ftp.ca.debian.org/debian/pool/main/g/gstreamer0.10/libgstreamer0.10-0_0.10.36-1.5_amd64.deb wget http://ftp.ca.debian.org/debian/pool/main/g/gst-plugins-base0.10/libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb
6. Install those packages.
sudo dpkg -i libgstreamer0.10-0_0.10.36-1.5_amd64.deb sudo dpkg -i libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb
7. Put those packages on hold so that they won’t get overwritten by the next software update.
sudo apt-mark hold libgstreamer-plugins-base0.10-0 sudo apt-mark hold libgstreamer0.10
8. Now its time to install R studio from the package we have downloaded in step 2.
sudo gdebi rstudio-server-1.1.442-amd64.deb
And done. You have just installed R studio on your machine. You can access it by searching for ‘ R studio’ application on your machine. It will be there on your machine. If you face any problem while installing R or R studio make sure that you ask in the comment section below.
You must be logged in to post a comment.