Counting part colors
Sometimes you'll want to do some processing before you do a join, and prioritize keeping the second (right) table's rows instead. In this case, a right join is for you.
In this exercise, we'll count the part_cat_id from parts, before using a right_join to join with part_categories. The reason we do this is because we don't only want to know the count of part_cat_id in parts, but we also want to know if there are any part_cat_ids not present in parts.
This exercise is part of the course
Joining Data with dplyr
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
parts %>%
# Count the part_cat_id
___ %>%
# Right join part_categories
___