Using dplyr's join functions in R to filter and merge data frames (CC164)
Channel: Riffomonas Project
Date: 2021-11-18

The ability to use dplyr's join functions to merge and filter data frames in R has made life so much easier than trying to do the same thing with base R. In this Code Club, Pat will demonstrate how to use and the difference between full_join, inner_join, left_join, right_join, and anti_join. He'll demonstrate how to use these functions with a massive data frame that we downloaded from Our World in Data that describes COVID-19 vaccination rates by country and day.

In this episode, Pat uses #inner_join, #left_join, #right_join, #full_join, and #anti_join from the #dplyr #R package in #Rstudio. The accompanying blog post can be found at https://www.riffomonas.org/code_club/2021-11-18-joins.

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 Joining data frames
3:52 full_join: returning all of the data
4:41 inner_join: returning the overlapping data
5:32 left_join and right_join: returning data in the left or right data frame
6:23 anti_join: returning the missing data
7:44 Using joins to filter data
9:50 Different methods of specifying which column to join by
11:07 Putting it all together