Mutating joins: extras

All mutating join functions have an argument keep =

  • defaults to NULL: equi joins retain only the key from x, while non-equi joins retain both keys
  • can be set to TRUE to force both keys to be retained in the output
flights2 |>
  inner_join(airlines, keep = TRUE)
## Joining with `by = join_by(carrier)`
## # A tibble: 336,776 × 8
##    year time_hour           origin dest  tailnum carrier.x carrier.y name       
##   <int> <dttm>              <chr>  <chr> <chr>   <chr>     <chr>     <chr>      
## 1  2013 2013-01-01 05:00:00 EWR    IAH   N14228  UA        UA        United Air…
## 2  2013 2013-01-01 05:00:00 LGA    IAH   N24211  UA        UA        United Air…
## 3  2013 2013-01-01 05:00:00 JFK    MIA   N619AA  AA        AA        American A…
## 4  2013 2013-01-01 05:00:00 JFK    BQN   N804JB  B6        B6        JetBlue Ai…
## # ℹ 336,772 more rows