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:

col_nametypesdescription
play_idcharacterPlay referencing id.
play_textcharacterA text description of the play.
home_idintegerHome team referencing id.
homecharacterHome team name.
away_idintegerAway team referencing id.
awaycharacterAway team name.
spreadnumericBetting lines provider spread.
home_balllogicalHome team has the ball.
home_scoreintegerHome team score.
away_scoreintegerAway team score.
downintegerDown of the play.
distanceintegerDistance to the sticks (to 1st down marker or goal-line in goal-to-go situations).
home_win_probnumericHome team win probability (0-1).
away_win_probnumericAway team win probability (0-1).
play_numberintegerGame play number.
yard_lineintegerYard line of the play (0-100 yards).

Examples

# \donttest{
  try(cfbd_metrics_wp(game_id = 401012356))
#> ── WP data from CollegeFootballData.com ────────────────────── cfbfastR 2.3.0 ──
#>  Data updated: 2026-06-13 04:18:17 UTC
#> # A tibble: 224 × 16
#>    play_id     play_text home_id home  away_id away  spread home_ball home_score
#>    <chr>       <chr>       <int> <chr>   <int> <chr>  <int> <lgl>          <int>
#>  1 4010123561… Joe Burr…     245 Texa…      99 LSU       -3 FALSE              0
#>  2 4010123561… Nick Bro…     245 Texa…      99 LSU       -3 FALSE              0
#>  3 4010123561… Joe Burr…     245 Texa…      99 LSU       -3 FALSE              0
#>  4 4010123561… Zach Von…     245 Texa…      99 LSU       -3 FALSE              0
#>  5 4010123561… Trayveon…     245 Texa…      99 LSU       -3 TRUE               0
#>  6 4010123561… Kellen M…     245 Texa…      99 LSU       -3 TRUE               0
#>  7 4010123561… Kellen M…     245 Texa…      99 LSU       -3 TRUE               0
#>  8 4010123561… Braden M…     245 Texa…      99 LSU       -3 TRUE               0
#>  9 4010123561… Joe Burr…     245 Texa…      99 LSU       -3 FALSE              0
#> 10 4010123561… Nick Bro…     245 Texa…      99 LSU       -3 FALSE              0
#> # ℹ 214 more rows
#> # ℹ 7 more variables: away_score <int>, down <int>, distance <int>,
#> #   home_win_prob <dbl>, away_win_prob <dbl>, play_number <int>,
#> #   yard_line <int>
# }