Chapter 2 Setting up R & Rstudio

2.1 Installing R & Rstudio

2.1.1 R

To download R, go to CRAN, the comprehensive R archive network https://cloud.r-project.org

2.1.2 RStudio

RStudio is an integrated development environment, or IDE, for R programming. If R is the engine, Rstudio is the steering wheel. Download and install it from http://www.rstudio.com/download.

2.2 Installing packages

After you install R & Rstuidio , you will also need to install some R packages.

The above video covers the topic but re-stated, to do what we need to do in this guide we’ll need to install and load certain packages.

To install a package (tidyverse is an example, but it’s a good example because it’s a big package that we will use a lot):

install.packages("tidyverse")

To load a package (tidyverse example), you can type the syntax below.

library(tidyverse)

2.3 Using Rmarkdown

We’ll use R Markdown to generate the reports in Chapter 9 and 11. The video below gives a nice introduction and overview of R markdown.