---
layout: post
title: "Using lubridate and ggplot2 to work with dates in R (CC234)"
blurb: "Has this year been wetter than most?"
author: "PD Schloss"
date: 2022-07-28 11:00
comments: false
youtube: facMJFmsUlw
start_hash: dbb92ea282c7dd4cf9685eb6d67c35f713573671
end_hash: 30f154f3c68d4c837792550d711fb3a5501d3988
---

The lubridate R package has a number of tools for working with dates and the ggplot2 R package has functions to plot data along a date-based axis. In this episode, Pat uses these tools to plot the cumulative precipitation over the year to find whether this year is wetter or drier than previous years. We'll do everything within RStudio.


<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/113eef3856d1ce2208a966db4439b71f4ea9e580) - There are some extra files in here since I needed to correct several bugs after recording other episodes
