Data Visualization and Maps II

Content for Wednesday, November 29, 2023

R provides a number of different packages for generating plots of your data, but ggplot2 is probably the most common owing to its ability to use consistent syntax to produce a variety of different graphics. In addition to plots of data and model objects, ggplot2 can also be used with sf objects and some raster datasets to generate publication quality maps. We’ll also take a little more time to understand some of the options for building static maps in R and look at a few packages that can help you build publication-quality maps without having to move into a new software.

Resources

Objectives

By the end of today you should be able to:

  • Understand the relationship between the Grammar of Graphics and ggplot syntax

  • Describe the various options for customizing ggplots and their syntactic conventions

  • Generate complicated plot layouts without additional pre-processing

  • Construct a map using ggplot2 and tmap

  • Combine vector and raster data in the same map

View all slides in new window Download PDF of all slides

Panopto Video

References

Healy, K. 2018. Data visualization: A practical introduction. Princeton University Press.