The base R unique() function removes duplicate records, leaving one copy of each distinct row. This is useful when a vertical NBA game-data table repeats a game once for each official. section 9.3
Deduplicating NBA game records
After removing variables beginning with off, call NBAboxscores <- unique(NBAboxscores). Check the result with dim(NBAboxscores): the data falls from 44,284 rows to 14,758 rows while retaining 117 columns. section 9.3
NBAboxscores <- unique(NBAboxscores) dim(NBAboxscores) ## [1] 14758 117
Inspect the executable unique() call and its resulting row and column dimensions. section 9.3


