
Lecture 5
Cornell University
INFO 2951 - Spring 2026
February 3, 2026
fill vs. colorfill when a geom is filledcolor when a geom is outlined
Keys uniquely link rows between tables
Often (but not always) the variable names are the same in both tables
Source: R4DS
| Name | Alignment | Gender | Publisher |
|---|---|---|---|
| Deadpool | Chaotic | Male | Marvel |
| Batman | Good | Male | DC |
| Sabrina | Good | Female | Archie Comics |
| Publisher | Year founded |
|---|---|
| DC | 1934 |
| Marvel | 1939 |
| Image | 1992 |
superheroespublisherssuperheroes and publishersinner_join()inner_join(x = superheroes, y = publishers, by = join_by(Publisher))
inner_join()left_join()left_join(x = superheroes, y = publishers, by = join_by(Publisher))
left_join()right_join()right_join(x = superheroes, y = publishers, by = join_by(Publisher))
right_join()right_join() reversedleft_join(x = publishers, y = superheroes, by = join_by(Publisher))
full_join()full_join(x = superheroes, y = publishers, by = join_by(Publisher))
full_join()# A tibble: 4 × 5
Name Alignment Gender Publisher `Year\nfounded`
<chr> <chr> <chr> <chr> <dbl>
1 Deadpool Chaotic Male "Marvel" 1939
2 Batman Good Male "DC" 1934
3 Sabrina Good Female "Archie\nComics" NA
4 <NA> <NA> <NA> "Image" 1992
semi_join()semi_join(x = superheroes, y = publishers, by = join_by(Publisher))
semi_join()anti_join()anti_join(x = superheroes, y = publishers, by = join_by(Publisher))
anti_join()Instructions
Join data from multiple data frames, summarize it, and create this plot.
ae-03Instructions
ae-03 (repo name will be suffixed with your GitHub name).renv::restore() to install the required packages, open the Quarto document in the repo, and follow along and complete the exercises.*_join() function appropriate for your analysis