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.5 ──
#>  Data updated: 2024-02-01 16:01:36 UTC
#> # A tibble: 246 × 6
#>    game_id   play_id        seconds_left home_win_percentage away_win_percentage
#>    <chr>     <chr>                 <int>               <dbl>               <dbl>
#>  1 401012356 4010123561018…            0               0.598               0.402
#>  2 401012356 4010123561018…            0               0.583               0.417
#>  3 401012356 4010123561018…            0               0.563               0.437
#>  4 401012356 4010123561018…            0               0.608               0.392
#>  5 401012356 4010123561018…            0               0.602               0.398
#>  6 401012356 4010123561018…            0               0.578               0.422
#>  7 401012356 4010123561018…            0               0.541               0.459
#>  8 401012356 4010123561018…            0               0.564               0.436
#>  9 401012356 4010123561018…            0               0.54                0.46 
#> 10 401012356 4010123561018…            0               0.564               0.436
#> # ℹ 236 more rows
#> # ℹ 1 more variable: tie_percentage <dbl>
# }