---
layout: post
title: "Visualizing correlation with double y-axes using the ggplot2 R package (CC235)"
blurb: "How and why not."
author: "PD Schloss"
date: 2022-08-01 11:00
comments: false
youtube: ir-NMcrYD-I
start_hash: 30f154f3c68d4c837792550d711fb3a5501d3988
end_hash: aa3c2d4c83053ceaabb34a6a2a54023c565fc4fb
---

Should you visualize your data using double y-axes? In this Code Club, Pat will show how to assess correlations using ggplot2 using faceted line plots, line plots on double y-axes, and using a scatter plot. Finally, he'll use cor.test to statistically assess the correlation between two variables. As always, there's a lot of other great gems to be found in the episode.


<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/climate_viz/tree/{{ page.start_hash }})
* [end of the episode](https://github.com/riffomonas/climate_viz/tree/{{ page.end_hash }})
* [corrected bugs](https://github.com/riffomonas/climate_viz/tree/76104c2aa99028e558cdcfe9d870aa14bd6c7f8e) - There are some extra files in here since I needed to correct several bugs after recording other episodes
