A left outer join merges two tables by matching key columns. It keeps every row from the left table and adds matching columns from the right table. When no match exists, the left-side row remains while the attached right-side values are missing. section 14.2.5 section 4.5.4
Use a left join when the left table defines the observations you must preserve:
- Prepare compatible key columns, renaming duplicate variables when necessary. section 6.3.2
- Call dplyr::left_join(left_table, right_table, by = ...) with one or more matching keys. section 6.3.2 section 12.7.1
- Inspect dimensions and columns afterward to verify that rows were preserved and that the expected fields were added. section 6.3.2 section 12.7.1
Combining NBA game records
Split game data into road and home tables, rename shared keys and side-specific variables, then join on dataset, ID, and date: left_join(road, home, by = c("dataset", "ID", "date")). The result retains all 2,073 road observations and adds matching home-team fields, producing 29 columns before unnecessary duplicates are removed. section 6.3.2
Adding team records to salary inequality data
Join gini6 with records by season_end and team to attach wins, losses, winning percentage, and championship status. The resulting gini_records object retains the 816 rows and gains the record variables for later analysis. section 12.7.1





