Acquire win probability for Major and Minor League games
Arguments
- game_pk
The game_pk for the game requested
- timecode
The time code for the MLB game (format: MMDDYYYY_HHMMSS)
Value
Returns a tibble that includes time codes from the game_pk requested
col_name | types |
home_team_win_probability | numeric |
away_team_win_probability | numeric |
home_team_win_probability_added | numeric |
at_bat_index | integer |
leverage_index | numeric |
Examples
# \donttest{
try(mlb_game_wp(game_pk = 531060))
#> ── MLB Game Win Probability data from MLB.com ─────── baseballr 1.6.0 ──
#> ℹ Data updated: 2024-04-13 21:56:18 UTC
#> # A tibble: 74 × 5
#> home_team_win_probabi…¹ away_team_win_probab…² home_team_win_probab…³
#> <dbl> <dbl> <dbl>
#> 1 52.2 47.8 2.2
#> 2 53.7 46.3 1.5
#> 3 52.5 47.5 -1.2
#> 4 54.7 45.3 2.2
#> 5 52.6 47.4 -2.1
#> 6 51 49 -1.6
#> 7 50 50 -1
#> 8 46.2 53.8 -3.8
#> 9 49.7 50.3 3.5
#> 10 52.6 47.4 2.9
#> # ℹ 64 more rows
#> # ℹ abbreviated names: ¹home_team_win_probability,
#> # ²away_team_win_probability, ³home_team_win_probability_added
#> # ℹ 2 more variables: at_bat_index <int>, leverage_index <dbl>
# }