calculate_expected_goals_v1: Calculate version 1 of the expected goals for all the events (plays) in a
play-by-play
Description
calculate_expected_goals_v1() calculates version 1 of the expected goals
for all the events (plays) in a play-by-play using a pre-estimated logistic
regression model of goal probability on distance, angle, empty net, and
strength state.
Usage
calculate_expected_goals_v1(play_by_play)
calculate_xG_v1(play_by_play)
Value
data.frame with one row per event (play) and added xG_v1 column
Arguments
play_by_play
data.frame of play-by-play(s); see gc_play_by_play()
and/or wsc_play_by_play() for reference; must be untouched by
non-nhlscraper functions; saves time if calculate_distance(),
calculate_angle(), and/or strip_situation_code() have already been called