Chapter 4 Game level data

For now, we’ll focus on the NBA data from the 2021-22 season. We work with regular season games only, and remove any columns we won’t use in the near term.

Code
library(tidyverse)
library(pubtheme)
d = readRDS('data/games.rds')
d = d %>% 
  filter(lg == 'nba', 
         season %in% 2021:2022, 
         season.type=='reg') %>%
  select(date, 
         away, home, 
         ascore, hscore, 
         season, gid)
head(d)
        date away home ascore hscore season      gid
1 2021-10-19  BKN  MIL    104    127   2022 22100001
2 2021-10-19  GSW  LAL    121    114   2022 22100002
3 2021-10-20  OKC  UTA     86    107   2022 22100011
4 2021-10-20  SAC  POR    124    121   2022 22100013
5 2021-10-20  DEN  PHX    110     98   2022 22100012
6 2021-10-20  ORL  SAS     97    123   2022 22100010