Skip to contents

Get college football game drives

Usage

cfbd_drives(
  year,
  season_type = "regular",
  week = NULL,
  team = NULL,
  offense_team = NULL,
  defense_team = NULL,
  conference = NULL,
  offense_conference = NULL,
  defense_conference = NULL,
  division = "fbs"
)

Arguments

year

(Integer required): Year, 4 digit format (YYYY)

season_type

(String default regular): Select Season Type: regular, postseason, or both

week

(Integer optional): Week - values from 1-15, 1-14 for seasons pre-playoff, i.e. 2013 or earlier

team

(String optional): D-I Team

offense_team

(String optional): Offense D-I Team

defense_team

(String optional): Defense D-I Team

conference

(String optional): DI Conference abbreviation - Select a valid FBS conference Conference abbreviations P5: ACC, B12, B1G, SEC, PAC Conference abbreviations G5 and FBS Independents: CUSA, MAC, MWC, Ind, SBC, AAC

offense_conference

(String optional): Offense DI Conference abbreviation - Select a valid FBS conference Conference abbreviations P5: ACC, B12, B1G, SEC, PAC Conference abbreviations G5 and FBS Independents: CUSA, MAC, MWC, Ind, SBC, AAC

defense_conference

(String optional): Defense DI Conference abbreviation - Select a valid FBS conference Conference abbreviations P5: ACC, B12, B1G, SEC, PAC Conference abbreviations G5 and FBS Independents: CUSA, MAC, MWC, Ind, SBC, AAC

division

(String optional): Division abbreviation - Select a valid division: fbs/fcs/ii/iii

Value

cfbd_drives() - A data frame with 23 variables as follows:

offense:character.

Drive offense.

offense_conference:character.

Drive offense's conference.

defense:character.

Drive defense.

defense_conference:character.

Drive defense's conference.

game_id:integer.

Unique game identifier - game_id.

drive_id:character.

Unique drive identifier - drive_id.

drive_number:integer.

Drive number in game.

scoring:logical.

Drive ends in a score.

start_period:integer.

Period (or Quarter) in which the drive starts.

start_yardline:integer.

Yard line at the drive start.

start_yards_to_goal:integer.

Yards-to-Goal at the drive start.

end_period:integer.

Period (or Quarter) in which the drive ends.

end_yardline:integer.

Yard line at drive end.

end_yards_to_goal:integer.

Yards-to-Goal at drive end.

plays:integer.

Number of drive plays.

yards:integer.

Total drive yards.

drive_result:character.

Result of the drive description.

is_home_offense:logical.

Flag for if the offense on the field is the home offense

start_offense_score:numeric.

Offense score at the start of the drive.

start_defense_score:numeric.

Defense score at the start of the drive.

end_offense_score:numeric.

Offense score at the end of the drive.

end_defense_score:numeric.

Defense score at the end of the drive.

time_minutes_start:integer.

Minutes at drive start.

time_seconds_start:integer.

Seconds at drive start.

time_minutes_end:integer.

Minutes at drive end.

time_seconds_end:integer.

Seconds at drive end.

time_minutes_elapsed:double.

Minutes elapsed during drive.

time_seconds_elapsed:integer.

Seconds elapsed during drive.

Examples

# \donttest{
  try(cfbd_drives(2018, week = 1, team = "TCU"))
#> ── Drives data from CollegeFootballData.com ────────────────── cfbfastR 1.9.3 ──
#>  Data updated: 2022-11-24 08:45:45 UTC
#> # A tibble: 25 × 28
#>    offense  offense_co…¹ defense defen…² game_id drive…³ drive…⁴ scoring start…⁵
#>    <chr>    <chr>        <chr>   <chr>     <int> <chr>     <int> <lgl>     <int>
#>  1 TCU      Big 12       Southe… SWAC     4.01e8 401013…       1 TRUE          1
#>  2 Southern SWAC         TCU     Big 12   4.01e8 401013…       2 FALSE         1
#>  3 TCU      Big 12       Southe… SWAC     4.01e8 401013…       3 TRUE          1
#>  4 Southern SWAC         TCU     Big 12   4.01e8 401013…       4 FALSE         1
#>  5 TCU      Big 12       Southe… SWAC     4.01e8 401013…       5 TRUE          1
#>  6 Southern SWAC         TCU     Big 12   4.01e8 401013…       6 FALSE         1
#>  7 TCU      Big 12       Southe… SWAC     4.01e8 401013…       7 TRUE          1
#>  8 Southern SWAC         TCU     Big 12   4.01e8 401013…       8 FALSE         2
#>  9 TCU      Big 12       Southe… SWAC     4.01e8 401013…       9 TRUE          2
#> 10 Southern SWAC         TCU     Big 12   4.01e8 401013…      10 TRUE          2
#> # … with 15 more rows, 19 more variables: start_yardline <int>,
#> #   start_yards_to_goal <int>, end_period <int>, end_yardline <int>,
#> #   end_yards_to_goal <int>, plays <int>, yards <int>, drive_result <chr>,
#> #   is_home_offense <lgl>, start_offense_score <int>,
#> #   start_defense_score <int>, end_offense_score <int>,
#> #   end_defense_score <int>, time_minutes_start <int>,
#> #   time_seconds_start <int>, time_minutes_end <int>, time_seconds_end <int>, …

  try(cfbd_drives(2018, team = "Texas A&M", defense_conference = "SEC"))
#> ── Drives data from CollegeFootballData.com ────────────────── cfbfastR 1.9.3 ──
#>  Data updated: 2022-11-24 08:45:46 UTC
#> # A tibble: 259 × 28
#>    offense       offen…¹ defense defen…² game_id drive…³ drive…⁴ scoring start…⁵
#>    <chr>         <chr>   <chr>   <chr>     <int> <chr>     <int> <lgl>     <int>
#>  1 Northwestern… Southl… Texas … SEC      4.01e8 401012…       1 FALSE         1
#>  2 Northwestern… Southl… Texas … SEC      4.01e8 401012…       3 FALSE         1
#>  3 Northwestern… Southl… Texas … SEC      4.01e8 401012…       5 FALSE         1
#>  4 Northwestern… Southl… Texas … SEC      4.01e8 401012…       7 FALSE         1
#>  5 Northwestern… Southl… Texas … SEC      4.01e8 401012…       9 FALSE         2
#>  6 Northwestern… Southl… Texas … SEC      4.01e8 401012…      11 FALSE         2
#>  7 Northwestern… Southl… Texas … SEC      4.01e8 401012…      13 FALSE         2
#>  8 Northwestern… Southl… Texas … SEC      4.01e8 401012…      15 FALSE         2
#>  9 Northwestern… Southl… Texas … SEC      4.01e8 401012…      17 FALSE         3
#> 10 Northwestern… Southl… Texas … SEC      4.01e8 401012…      19 FALSE         3
#> # … with 249 more rows, 19 more variables: start_yardline <int>,
#> #   start_yards_to_goal <int>, end_period <int>, end_yardline <int>,
#> #   end_yards_to_goal <int>, plays <int>, yards <int>, drive_result <chr>,
#> #   is_home_offense <lgl>, start_offense_score <int>,
#> #   start_defense_score <int>, end_offense_score <int>,
#> #   end_defense_score <int>, time_minutes_start <int>,
#> #   time_seconds_start <int>, time_minutes_end <int>, time_seconds_end <int>, …
# }