Join data frames in R with inner_join and anti_join (CC254)
Channel: Riffomonas Project
Date: 06/10/2022

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.

You can find my blog post for this episode at https://www.riffomonas.org/code_club/2022-10-06-joining.

#inner_join #anti_join #Rstats #R 

Support Riffomonas by becoming a Patreon member!
https://www.patreon.com/riffomonas

Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at https://shop.riffomonas.org/youtube to get practice problems, tips, and insights.

If you're interested in taking an upcoming 3 day R workshop be sure to check out our schedule at https://riffomonas.org/workshops/

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://www.riffomonas.org/generalR/

0:00 Introduction
1:58 Using station inventory data to capture date ranges
8:43 Retaining all precipitation data and tossing bad dates
15:50 Joining data with inner_join and anti_join
20:11 Summarizing mean precipitation by region and year