Anisa Dhana shows off several tidyverse methods for combining data sets together:
semi_join
Thesemi_join
function is different than the previous examples of joins. A semi join creates a new dataset in which there are all rows from thedata1
where there is a corresponding matching value indata2
. Still, instead of the final dataset merging both the first (data1) and second (data2) datasets, it only contains the variables from the first one (data1).
Most of this looks like standard SQL joins, but read through to the end for a bonus which doesn’t typically appear in relational database products.