Use dplyr's distinct() to keep one row for each unique combination of selected columns. In NBA data, checking Year, Player, and Pos exposes repeated player-season-position combinations created by multi-team records and total rows. section 19.3.1
Check duplicate player combinations
dat1 %>% distinct(Year, Player, Pos) -> test1 dim(test1) ## [1] 12239 3 The result contains 12,239 unique combinations, 2,181 fewer observations than dat1. This identifies duplicate combinations; it does not add their statistics together. Aggregation can follow separately with group_by() and summarize(). section 19.3.1
Use distinct() to:
- Select unique records across one or several columns. section 19.5
- Inspect whether apparent duplicates represent total rows or repeated records before standardizing the data. section 19.3.1



