powered by
Helper function to prepare hockeyR pbp data for xG calculations
prepare_xg_data(x)
A tibble; pbp data with xG model mutations along with identifiers for game and strength state
A play-by-play data frame generated by hockeyR before xG is calculated
if (FALSE) { pbp <- load_pbp(2022) %>% dplyr::select(-xg) model_data <- prepare_xg_data(pbp) }
Run the code above in your browser using DataLab