# 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.

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.

`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.