Skip to contents

Get win probability chart data from API

Usage

cfbd_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

cfbd_metrics_wp() - A data frame with 16 variables:

play_id: character.

Play referencing id.

play_text: character.

A text description of the play.

home_id: integer.

Home team referencing id.

home: character.

Home team name.

away_id: integer.

Away team referencing id.

away: character.

Away team name.

spread: character.

Betting lines provider spread.

home_ball: logical.

Home team has the ball.

home_score: integer.

Home team score.

away_score: integer.

Away team score.

down: integer.

Down of the play.

distance: integer.

Distance to the sticks (to 1st down marker of goal-line in goal-to-go situations).

home_win_prob: character.

Home team win probability.

away_win_prob: double.

Away team win probability.

play_number: integer.

Game play number.

yard_line: integer.

Yard line of the play (0-100 yards).

Examples

# \donttest{
  try(cfbd_metrics_wp(game_id = 401012356))
#> ── WP data from CollegeFootballData.com ────────────────────── cfbfastR 1.9.3 ──
#>  Data updated: 2022-09-23 03:23:17 UTC
#> # A tibble: 224 × 16
#>    play_id    play_…¹ home_id home  away_id away  spread home_…² home_…³ away_…⁴
#>    <chr>      <chr>     <int> <chr>   <int> <chr> <chr>  <lgl>     <int>   <int>
#>  1 401012356… Joe Bu…     245 Texa…      99 LSU   -3     FALSE         0       0
#>  2 401012356… Nick B…     245 Texa…      99 LSU   -3     FALSE         0       0
#>  3 401012356… Joe Bu…     245 Texa…      99 LSU   -3     FALSE         0       0
#>  4 401012356… Zach V…     245 Texa…      99 LSU   -3     FALSE         0       0
#>  5 401012356… Trayve…     245 Texa…      99 LSU   -3     TRUE          0       0
#>  6 401012356… Kellen…     245 Texa…      99 LSU   -3     TRUE          0       0
#>  7 401012356… Kellen…     245 Texa…      99 LSU   -3     TRUE          0       0
#>  8 401012356… Braden…     245 Texa…      99 LSU   -3     TRUE          0       0
#>  9 401012356… Joe Bu…     245 Texa…      99 LSU   -3     FALSE         0       0
#> 10 401012356… Nick B…     245 Texa…      99 LSU   -3     FALSE         0       0
#> # … with 214 more rows, 6 more variables: down <int>, distance <int>,
#> #   home_win_prob <chr>, away_win_prob <dbl>, play_number <int>,
#> #   yard_line <int>, and abbreviated variable names ¹​play_text, ²​home_ball,
#> #   ³​home_score, ⁴​away_score
# }