Lesson 3 - Install R and RStudio

What you will learn in this lesson:

• How to install R
• How to install RStudio

To begin your R journey, you need to install R on your computer. You need to install two components: R and RStudio.

Why do you need to install two different apps? In theory, you could just install R. But RStudio makes working with R easier, more enjoyable and less error-prone. In other words, using RStudio will increase your productivity.

RStudio is an IDE — Integrated Development Environment. RStudio is an interface, an extra layer, on top of R specifically designed and optimized for R.

To summarize:

  • you need to install R so that your computer can run R code
  • you can install RStudio to work more productively with R

Let’s install R and RStudio.

Here comes the first advantage of R compared to Stata, SAS and SPSS—among others: R and RStudio are free to download and to use. You do not need to pay for a license. You do not need to pay for an upgrade. You do not need to crack the license—cracking a license always comes with security risks for your computer. You just install R and RStudio.

Let’s start by downloading the installers.

Start by running the R installer. Then, run the RStudio installer.

If you are on a Mac and use Homebrew, you can install RStudio with brew install --cask rstudio. I do not recommend installing R itself with Homebrew. I tried, and it created a lot of problems.

You now have R and RStudio installed in your computer. Congratulations! Let’s finish the set of free lessons by writing your first R code.