Get college football play-by-play data.
Usage
cfbd_plays(
year = 2020,
season_type = "regular",
week = 1,
team = NULL,
offense = NULL,
defense = NULL,
conference = NULL,
offense_conference = NULL,
defense_conference = NULL,
play_type = NULL,
division = "fbs"
)Arguments
- year
Select year, (example: 2018)
- season_type
(String default regular): Season type - regular, postseason, both, allstar, spring_regular, spring_postseason
- week
Select week, this is optional (also numeric)
- team
Select team name (example: Texas, Texas A&M, Clemson)
- offense
Select offense name (example: Texas, Texas A&M, Clemson)
- defense
Select defense name (example: Texas, Texas A&M, Clemson)
- conference
Select conference name (example: ACC, B1G, B12, SEC, PAC, MAC, MWC, CUSA, Ind, SBC, AAC, Western, MVIAA, SWC, PCC, Big 6, etc.)
- offense_conference
Select conference name (example: ACC, B1G, B12, SEC, PAC, MAC, MWC, CUSA, Ind, SBC, AAC, Western, MVIAA, SWC, PCC, Big 6, etc.)
- defense_conference
Select conference name (example: ACC, B1G, B12, SEC, PAC, MAC, MWC, CUSA, Ind, SBC, AAC, Western, MVIAA, SWC, PCC, Big 6, etc.)
- play_type
Select play type (example: see the cfbd_play_type_df)
- division
(String optional): Division abbreviation - Select a valid division: fbs/fcs/ii/iii
Value
cfbd_plays() - A data frame with 27 columns:
| col_name | types | description |
| play_id | character | CFBD play identifier (unique within a game when combined with game_id). |
| offense | character | Full name of the offense (team in possession) on the play. |
| offense_conference | character | Conference name of the offense (e.g. "SEC", "ACC"). |
| defense | character | Full name of the defense on the play. |
| defense_conference | character | Conference name of the defense (e.g. "SEC", "ACC"). |
| home | character | Full home team name for the game. |
| away | character | Full away team name for the game. |
| offense_score | integer | Offense's score after the play (points). |
| defense_score | integer | Defense's score after the play (points). |
| game_id | integer | CFBD game identifier the play belongs to. |
| drive_id | character | CFBD drive identifier the play belongs to. |
| drive_number | integer | Sequential drive number within the game (1-indexed). |
| play_number | integer | Sequential play number within the game (1-indexed). |
| period | integer | Game period / quarter (1-4 regulation, 5+ overtime). |
| offense_timeouts | integer | Timeouts remaining for the offense at the end of the play. |
| defense_timeouts | integer | Timeouts remaining for the defense at the end of the play. |
| yard_line | integer | Field-position yard line at the start of the play (0-50 scale from the offense's side). |
| yards_to_goal | integer | Distance in yards from the offense's spot to the opponent's goal line (0-100). |
| down | integer | Down of the play (1-4). |
| distance | integer | Yards to gain for a first down (or to the goal line in goal-to-go situations). |
| scoring | logical | TRUE when the play results in a score (TD, FG, safety, two-point conversion). |
| yards_gained | integer | Net yards gained by the offense on the play. |
| play_type | character | CFBD categorical label for the play type (see cfbd_play_types()). |
| play_text | character | Free-form text description of the play from the CFBD feed. |
| ppa | character | Predicted Points Added (CFBD's CFB-EPA analogue) for the play. |
| clock_minutes | integer | Minutes remaining on the game clock at the start of the play. |
| clock_seconds | integer | Seconds remaining on the game clock at the start of the play. |
Examples
# \donttest{
try(cfbd_plays(year = 2021, week = 1))
#> ── Play-by-play data from CollegeFootballData.com ──────────── cfbfastR 2.3.0 ──
#> ℹ Data updated: 2026-06-13 04:19:54 UTC
#> # A tibble: 15,066 × 28
#> game_id drive_id play_id drive_number play_number offense offense_conference
#> <int> <chr> <chr> <int> <int> <chr> <chr>
#> 1 4.01e8 4012827… 401282… 1 1 Illino… Big Ten
#> 2 4.01e8 4012827… 401282… 1 7 Nebras… Big Ten
#> 3 4.01e8 4012827… 401282… 1 6 Nebras… Big Ten
#> 4 4.01e8 4012827… 401282… 1 5 Nebras… Big Ten
#> 5 4.01e8 4012827… 401282… 1 4 Nebras… Big Ten
#> 6 4.01e8 4012827… 401282… 1 3 Nebras… Big Ten
#> 7 4.01e8 4012827… 401282… 1 2 Nebras… Big Ten
#> 8 4.01e8 4012827… 401282… 2 5 Illino… Big Ten
#> 9 4.01e8 4012827… 401282… 2 4 Illino… Big Ten
#> 10 4.01e8 4012827… 401282… 2 3 Illino… Big Ten
#> # ℹ 15,056 more rows
#> # ℹ 21 more variables: offense_score <int>, defense <chr>,
#> # defense_conference <chr>, defense_score <int>, home <chr>, away <chr>,
#> # period <int>, offense_timeouts <int>, defense_timeouts <int>,
#> # yardline <int>, yards_to_goal <int>, down <int>, distance <int>,
#> # yards_gained <int>, scoring <lgl>, play_type <chr>, play_text <chr>,
#> # ppa <dbl>, wallclock <chr>, clock_minutes <int>, clock_seconds <int>
# }
