
Calculate version 1 of the expected goals for all the events (plays) in a play-by-play
Source:R/Model.R
calculate_expected_goals_v1.Rdcalculate_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.
Arguments
- play_by_play
data.frame of play-by-play(s); see
gc_play_by_play()and/orwsc_play_by_play()for reference; must be untouched by non-nhlscraper functions; saves time ifcalculate_distance(),calculate_angle(), and/orstrip_situation_code()have already been called
Examples
# May take >5s, so skip.
# \donttest{
test <- gc_play_by_play()
test <- calculate_expected_goals_v1(test)
# }