---
layout: post
title: "Using the patchwork R package to combine two ggplot2 plots into one figure (CC166)"
blurb: "Assembling figures with patchwork"
author: "PD Schloss"
date: 2021-11-24 11:00
comments: false
youtube: _5i4HDrKM8I
start_hash: 9cb53f5fd245cbcca3c038ffa45b1f9cc915d09c
end_hash: 33218e846b4c1463498d69044014bc76e830d9f1
---

The patchwork R package is a powerful tool for combining multiple plots into one figure. In this Code Club, Pat will show viewers how to use patchwork to combine a dot chart and barbell chart he creates using ggplot2 into a single figure. Along the way he'll discuss how to give the figure a common title and how to apply a theme across the figure to make an attractive data visual. The question he is trying to answer with these plots is whether people's stated intention to receive the COVID-19 vaccine in October 2020 matched whether they actually received the vaccine as of October of 2021. He'll demonstrate how to build these figures generated using data from Ipsos and Our World in Data that describes COVID-19 vaccination intention and rates by country and day.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


## Code

You can browse the state of the repository at the
* [beginning of the episode](https://github.com/riffomonas/vaccination_attitudes/tree/{{ page.start_hash }})
* [end of the episode](https://github.com/riffomonas/vaccination_attitudes/tree/{{ page.end_hash }})
