Finding an observation that doesn't have a match
Left joins are really great for testing your assumptions about a data set and ensuring your data has integrity.
For example, the inventories table has a version column, for when a LEGO kit gets some kind of change or upgrade. It would be fair to assume that all sets (which joins well with inventories) would have at least a version 1. But let's test this assumption out in the following exercise.
Cet exercice fait partie du cours
Joining Data with dplyr
Instructions
- Use a
left_jointo join togethersetsandinventory_version_1using their common column. filterfor where theversioncolumn isNAusingis.na.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
inventory_version_1 <- inventories %>%
filter(version == 1)
# Join versions to sets
sets %>%
___ %>%
# Filter for where version is na
___