16.3 Installation

16.3.1 R

Download and install the latest version of R from:


Windows: Download R for Windows - base - Download R 3.6.0 for Windows

Mac: Download R for (Mac) OS X - R-3.6.0.pkg

16.3.2 RStudio

Then download and install RStudio:


Windows: RStudio 1.2.1335 - Windows 7+

Mac: RStudio 1.2.1335 - Mac OS X 10.12+ (64-bit)

16.3.3 R packages

Open RStudio and copy-paste the lines below into the Console and press Enter:

Then Restart R before running the next two lines (same as before, copy-paste to the Console):

If it asks you “Do you want to restart your R session”, press Yes the first time. If it immediately asks again, press No.

Code to check tinyTex and Tex working as expected:

If you already have LaTex installed on your computer, the tinytex::install_tinytex() one is not necessary and might not work. This is fine, there is no harm in copy-pasting in anyway if you are not sure.

Bryan, Jennifer. 2017. Gapminder: Data from Gapminder. https://CRAN.R-project.org/package=gapminder.

Wickham, Hadley. 2016. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. https://ggplot2.tidyverse.org.