Description Usage Arguments Value
View source: R/ep_wp_calculator.R
Given a dataset of plays and the necessary variables, this function returns the original dataset with the win probability from the nflscrapR model.
1 2 3 | calculate_win_probability(pbp_data, half_seconds_remaining,
game_seconds_remaining, score_differential, quarter, posteam_timeouts_pre,
oppteam_timeouts_pre, ep)
|
pbp_data |
Play-by-play dataset to estimate expected points for. |
half_seconds_remaining |
String denoting the name of the column of the pbp_data containing the number of seconds remaining in the current half. |
game_seconds_remaining |
String denoting the name of the column of the pbp_data containing the number of seconds remaining in the game. |
score_differential |
String denoting the name of the column of the pbp_data containing the score differential with respect to the possession team. |
quarter |
String denoting the name of the column of the pbp_data containing the quarter of the play (anything above 4 is considered overtime). |
posteam_timeouts_pre |
String denoting the name of the column of the pbp_data containing the number of timeouts remaining for the team with possession. |
oppteam_timeouts_pre |
String denoting the name of the column of the pbp_data containing the number of timeouts remaining for the opposing team. |
ep |
String denoting the name of the column of the pbp_data containing the expected points with respect to the possession team for the play. |
The original pbp_data with a column named wp containing the win probability with respect to the team with possession.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.