Something within one set but not another
In the videos, you learned how to filter using the semi- and anti join verbs to answer questions you have about your data. Let's focus on the batwing dataset, and use our skills to determine which parts are in both the batwing and batmobile sets, and which sets are in one, but not the other. While answering these questions, we'll also be determining whether or not the parts we're looking at in both sets also have the same color in common.
The batmobile and batwing datasets have been preloaded for you.
batmobile <- inventory_parts_joined %>%
filter(set_num == "7784-1") %>%
select(-set_num)
batwing <- inventory_parts_joined %>%
filter(set_num == "70916-1") %>%
select(-set_num)
Cet exercice fait partie du cours
Joining Data with dplyr
Instructions
- Filter the
batwingset for parts that are also in thebatmobile, whether or not they have the same color. - Filter the
batwingset for parts that aren't also in thebatmobile, whether or not they have the same color.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Filter the batwing set for parts that are also in the batmobile set
batwing %>%
___
# Filter the batwing set for parts that aren't in the batmobile set
batwing %>%
___