All Images

Before we Start


Figure 1

RStudio extends what R can do, and makes it easier to write R code and interact with R.

Figure 2

automatic car gear shift representing the ease of RStudio

Figure 3

Screenshot of the RStudio_startup screen

Figure 4

Example of a working directory structure

Figure 5

Screenshot of Packages pane

Figure 6

Screenshot of Install Packages Window

Introduction to R


Starting with Data


Figure 1

A 3 by 3 data frame with columns showing numeric, character and logical values.

Figure 2

Monsters at a fork in the road, with signs saying here, and not here. One direction, not here, leads to a scary dark forest with spiders and absolute filepaths, while the other leads to a sunny, green meadow, and a city below a rainbow and a world free of absolute filepaths. Art by Allison Horst
Image credit: Allison Horst

Figure 3

Bar plot of Number of Cases per Ballot Type

Figure 4

Bar plot of Number of Cases per Ballot Type (including missing values)

Figure 5

Bar plot of Number of Cases per Ballot Type (including missing values)

Data Wrangling with dplyr


Data Wrangling with tidyr


Figure 1

A visual representation of the three rules that define a 'tidy' data set.R for Data Science, Wickham H and Grolemund G (https://r4ds.had.co.nz/index.html) © Wickham, Grolemund 2017 This image is licensed under Attribution-NonCommercial-NoDerivs 3.0 United States (CC-BY-NC-ND 3.0 US)


Figure 2

A gif showing how long and wide tibble layouts relate to each other.
Animation showing pivot_wider and pivot_longer functions transforming data between long and wide formats

Data Visualisation with ggplot2


Getting Started with R Markdown (optional)


Figure 1

R Markdown wizard monsters creating a R Markdown document from a recipe. Art by Allison Horst

Figure 2

Screenshot of the New R Markdown file dialogue box in RStudio

Figure 3

The 'knitting' process: First, R Markdown is converted to Markdown, which is then converted (via pandoc) to .html, .pdf, .docx, etc.

Figure 4


Figure 5

I made this plot while attending an awesome workshop where I learned a ton of cool stuff!
I made this plot while attending an awesome workshop where I learned a ton of cool stuff!