Skip to contents

ESPN Metrics

Get win probability chart data from ESPN Graciously contributed by MrCaseB:

Usage

espn_metrics_wp(game_id)

Arguments

game_id

(Integer required): Game ID filter for querying a single game Can be found using the cfbd_game_info() function

Value

espn_metrics_wp() - A data frame with 5 variables:

game_id: character.

Referencing game ID (should be same as game_id from other functions).

play_id: character.

Referencing play ID.

seconds_left: integer.

Seconds left in the game.

home_win_percentage: double.

The probability of the home team winning the game.

away_win_percentage: double.

The probability of the away team winning the game (calculated as 1 - home_win_percentage - tie_percentage).

tie_percentage: double.

The probability of the game ending the final period in a tie.

Examples

# \donttest{
  try(espn_metrics_wp(game_id = 401012356))
#> ── Win probability chart data from ESPN ────────────────────── cfbfastR 1.9.3 ──
#>  Data updated: 2022-11-24 08:46:42 UTC
#> # A tibble: 246 × 6
#>    game_id   play_id            seconds_left home_win_percentage away_…¹ tie_p…²
#>    <chr>     <chr>                     <int>               <dbl>   <dbl>   <dbl>
#>  1 401012356 401012356101849901            0               0.598   0.402       0
#>  2 401012356 401012356101849902            0               0.583   0.417       0
#>  3 401012356 401012356101855402            0               0.563   0.437       0
#>  4 401012356 401012356101859801            0               0.608   0.392       0
#>  5 401012356 401012356101866401            0               0.602   0.398       0
#>  6 401012356 401012356101867401            0               0.578   0.422       0
#>  7 401012356 401012356101875401            0               0.541   0.459       0
#>  8 401012356 401012356101879401            0               0.564   0.436       0
#>  9 401012356 401012356101884101            0               0.54    0.46        0
#> 10 401012356 401012356101885801            0               0.564   0.436       0
#> # … with 236 more rows, and abbreviated variable names ¹​away_win_percentage,
#> #   ²​tie_percentage
# }