calculate_xg: Calculate hockeyR expected goals (xG)

View source: R/calculate_xg.R

calculate_xgR Documentation

Calculate hockeyR expected goals (xG)

Description

Uses the hockeyR expected goals model to calculate xG for any pbp data frame generated by hockeyR

Usage

calculate_xg(pbp)

Arguments

pbp

A play-by-play data frame, previously returned by hockeyR::scrape_game

Value

The original supplied play-by-play data with a column for expected goals appended

Examples

## Not run: 
pbp <- load_pbp(2022) %>% dplyr::select(-xg)
pbp_preds <- calculate_xg(pbp)

## End(Not run)

hockeyR documentation built on Oct. 12, 2022, 5:07 p.m.