---
layout: post
title: "Join data frames in R with inner_join and anti_join (CC254)"
blurb: "Fun with inner_join and anti_join"
author: "PD Schloss"
date: 2022-10-06 11:00
comments: false
youtube: 3rVvgfcpM-k
start_hash: d80b9db189efa22c7d77162a6e667724519bcf9d
end_hash: 5b8fce306852f2969bee1a0a0cd19d724984bf9a
---

Pat shows how to join two data frames with `inner_join` and how to identify samples that are in one data frame but not the other with `anti_join`. Along the way he'll also show some tricks with lubridate's `ymd` function and tidyr's `replace_na` function. Finally, Pat summarizes the average amount of precipitation over the past 30 days for each latitude and longitude over the past 100+ years. He also reviews how to use `read_fwf` to read in a fixed-width formatted text file. The overall goal of this project is to highlight reproducible research practices using a number of tools. The specific output from this project will be a map-based visual that shows the level of drought across the globe.

<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/drought_index/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/drought_index/tree/{{page.end_hash}})
