Getting Started with Data Science using R on Linux Mint

A Rookie’s Journey of Learning Data Science

Dhiraj Raut
3 min readOct 18, 2021
Photo by Luke Chesser on Unsplash

Where should we start now? Let’s start from the beginning here. I must confess that I’m not a pro writer or a coder. Just to learn something new, I’m starting Data Science. Data Science is a vague subject and learning it can be tough. But I’m taking on a challenge to learn it. I haven’t decided the duration for the completion but let’s do a 30 day challenge.

I’m working on Linux Mint 20.2 “Uma” with a barely alive computer. The computer is a 6 years old DELL Inspiron with Celeron Processor of clock speed of 1.4 GHz. (Show me some pity here.) Anyway, I hope that you are having a really good PC and a faster CPU. At the end of the day, specs don’t matter so it is what it is.

Enough of all these. Let’s get started.

DAY 1: Installing R and RStudio

This is where the real pain starts. It’s not simple to install R and RStudio like we install other programs on Linux. (The truth is installing any application on Linux is really tough for an age-old Windows user.)

Step 1: Check if R is already installed on your PC

You never know what’s installed on your device. If you’re lucky then, who knows, R might already be installed on your PC which is very unlikely. So, you can check if R is installed or not using the following command in your Terminal.

$ R --version

This will show the version of R installed on your Mint or any Linux Distro. If it is installed, then it will show some information like below:

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"Copyright (C) 2020 The R Foundation for Statistical ComputingPlatform: x86_64-pc-linux-gnu (64-bit)R is free software and comes with ABSOLUTELY NO WARRANTY.You are welcome to redistribute it under the terms of theGNU General Public License versions 2 or 3.For more information about these matters seehttps://www.gnu.org/licenses/.

Step 2: Installing R

If R is not installed on your device then you can simply install by clicking here and following the steps. Since Linux Mint is based on Ubuntu 20.04, you can follow the steps accordingly. Believe me just copy paste the command and it will work.

# update indices 
apt update -qq
# install two helper packages we need
apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# Fingerprint: 298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"apt install --no-install-recommends r-base

Again, make sure if R is installed. Once R is installed then it’s time to install RStudio. Installing R studio is quite simpler than installing R.

Step 3: Installing RStudio

For downloading RStudio, simply navigate here . Choose the RStudio Desktop (or any version of your choice) and click on Download. This will redirect to a page having various versions. Just select Ububtu18/Debian 10 version and this will download a .deb file. Make sure that you download it in the folder that you’ll remember. For convenience, download the file in the Downloads folder. Then follow the simple commands written below:

#change to the location of Download folder
$ cd Downloads/
#install the .deb file
$ sudo apt install ./rstudio-2021.09.0-351-amd64.deb

And this will take some time depending upon your PC and the Internet speed. Once completed, then navigate to Start Menu and search for RStudio.

There you go. You have RStudio up and running.

But if you’re lazy, like me, then the video below will help you.

I will be updating the post on a daily basis so that I have a reason to continue learning.

--

--