Chapter 1 Intro

This is a beginner’s guide to ggplot2 and data visualisation. It will assume the following things:

  • You have installed R and RStudio
  • You know how to install and load packages in R
  • You know the absolute basics of R, e.g., what a function is, how to run a line of code. If you’d like to recap these basics, you may find the Programming Basics Chapter of my MSc book useful
  • You have a basic level of data visualisation comprehension, e.g., you can read various types of graphs
  • You haven’t got a clue how to make these graphs in R

This tutorial was the result of a request by David Tree for anti-racism curriculum materials. The data used is from the Slave Voyages project. The Trans-Atlantic Slave Trade Database comprises 36,000 individual slaving expeditions between 1514 and 1866. This dataset is horrifying and so is the history contained within the graphs you will produce.

Where additional instruction or detail about certain basic R functions might be helpful, I will point to relevant chapters of my MSc data skills book to avoid duplication.

The code for this tutorial is available on GitHub with a Creative Commons licence. You may use it and adapt with without any further permission.