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 = 401114164))
#> ── Win probability chart data from ESPN ────────────────────── cfbfastR 1.9.0 ──
#>  Data updated: 2022-06-15 19:51:25 UTC
#> # A tibble: 200 × 6
#>    game_id play_id seconds_left home_win_percen… away_win_percen… tie_percentage
#>    <chr>   <chr>          <int>            <dbl>            <dbl>          <dbl>
#>  1 401114… 401114…         3600            0.405            0.595              0
#>  2 401114… 401114…         3594            0.409            0.591              0
#>  3 401114… 401114…         3563            0.414            0.586              0
#>  4 401114… 401114…         3525            0.372            0.628              0
#>  5 401114… 401114…         3492            0.37             0.63               0
#>  6 401114… 401114…         3487            0.418            0.582              0
#>  7 401114… 401114…         3450            0.375            0.625              0
#>  8 401114… 401114…         3442            0.395            0.605              0
#>  9 401114… 401114…         3439            0.405            0.595              0
#> 10 401114… 401114…         3433            0.437            0.563              0
#> # … with 190 more rows
# }