calculate_xg | R Documentation |
Uses the hockeyR expected goals model to calculate xG for any pbp data frame generated by hockeyR
calculate_xg(pbp)
pbp |
A play-by-play data frame, previously returned by hockeyR::scrape_game |
The original supplied play-by-play data with a column for expected goals appended
## Not run: pbp <- load_pbp(2022) %>% dplyr::select(-xg) pbp_preds <- calculate_xg(pbp) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.