Learn R Programming

hockeyR (version 1.3.0)

prepare_xg_data: Prepare xG data

Description

Helper function to prepare hockeyR pbp data for xG calculations

Usage

prepare_xg_data(x)

Value

A tibble; pbp data with xG model mutations along with identifiers for game and strength state

Arguments

x

A play-by-play data frame generated by hockeyR before xG is calculated

Examples

Run this code
if (FALSE) {
pbp <- load_pbp(2022) %>% dplyr::select(-xg)
model_data <- prepare_xg_data(pbp)
}

Run the code above in your browser using DataLab