mlb_game_wp: *Acquire win probability for Major and Minor League games*

View source: R/mlb_game_wp.R

mlb_game_wpR Documentation

Acquire win probability for Major and Minor League games

Description

Acquire win probability for Major and Minor League games

Usage

mlb_game_wp(game_pk, timecode = NULL)

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 description
home_team_win_probability numeric Home team win probability (percent) entering the at-bat.
away_team_win_probability numeric Away team win probability (percent) entering the at-bat.
home_team_win_probability_added numeric Change in home team win probability attributed to the at-bat.
at_bat_index integer Zero-based index of the at-bat within the game.
leverage_index numeric Leverage index quantifying the importance of the at-bat situation.

Examples


  try(mlb_game_wp(game_pk = 531060))


baseballr documentation built on Aug. 27, 2026, 1:07 a.m.