Skip to contents

Load and Install Packages

if (!requireNamespace('pacman', quietly = TRUE)){
  install.packages('pacman')
}
pacman::p_load(dplyr,tidyr, gt)
pacman::p_load_current_gh("sportsdataverse/cfbfastR")

Get Team Info

cfbd_team_info(conference = "SEC")
## ── Team information from CollegeFootballData.com ───────────── cfbfastR 1.9.0 ──
##  Data updated: 2022-06-15 19:53:25 UTC
## # A tibble: 14 × 27
##    team_id school   mascot abbreviation alt_name1 alt_name2 alt_name3 conference
##      <int> <chr>    <chr>  <chr>        <chr>     <chr>     <chr>     <chr>     
##  1     333 Alabama  Crims… ALA          NA        ALA       Alabama   SEC       
##  2       8 Arkansas Razor… ARK          NA        ARK       Arkansas  SEC       
##  3       2 Auburn   Tigers AUB          NA        AUB       Auburn    SEC       
##  4      57 Florida  Gators FLA          NA        FLA       Florida   SEC       
##  5      61 Georgia  Bulld… UGA          NA        UGA       Georgia   SEC       
##  6      96 Kentucky Wildc… UK           NA        UK        Kentucky  SEC       
##  7      99 LSU      Tigers LSU          Louisian… LSU       LSU       SEC       
##  8     344 Mississ… Bulld… MSST         NA        MSST      Miss St   SEC       
##  9     142 Missouri Tigers MIZ          NA        MIZ       Missouri  SEC       
## 10     145 Ole Miss Rebels MISS         NA        MISS      Ole Miss  SEC       
## 11    2579 South C… Gamec… SC           NA        SC        South Ca… SEC       
## 12    2633 Tenness… Volun… TENN         NA        TENN      Tennessee SEC       
## 13     245 Texas A… Aggies TA&M         NA        TA&M      Texas A&M SEC       
## 14     238 Vanderb… Commo… VAN          NA        VAN       Vanderbi… SEC       
## # … with 19 more variables: division <chr>, color <chr>, alt_color <chr>,
## #   logo <chr>, logo_2 <chr>, venue_id <int>, venue_name <chr>, city <chr>,
## #   state <chr>, zip <chr>, country_code <chr>, timezone <chr>, latitude <dbl>,
## #   longitude <dbl>, elevation <chr>, capacity <int>, year_constructed <int>,
## #   grass <lgl>, dome <lgl>
cfbd_team_info(conference = "Ind")
## ── Team information from CollegeFootballData.com ───────────── cfbfastR 1.9.0 ──
##  Data updated: 2022-06-15 19:53:25 UTC
## # A tibble: 7 × 27
##   team_id school    mascot abbreviation alt_name1 alt_name2 alt_name3 conference
##     <int> <chr>     <chr>  <chr>        <chr>     <chr>     <chr>     <chr>     
## 1     349 Army      Black… ARMY         NA        ARMY      Army      FBS Indep…
## 2     252 BYU       Couga… BYU          Brigham … BYU       BYU       FBS Indep…
## 3      41 Connecti… Huski… CONN         NA        CONN      UConn     FBS Indep…
## 4    2335 Liberty   Flames LIB          NA        LIB       Liberty   FBS Indep…
## 5     166 New Mexi… Aggies NMSU         NA        NMSU      New Mexi… FBS Indep…
## 6      87 Notre Da… Fight… ND           NA        ND        Notre Da… FBS Indep…
## 7     113 UMass     Minut… UMASS        NA        UMASS     UMass     FBS Indep…
## # … with 19 more variables: division <lgl>, color <chr>, alt_color <chr>,
## #   logo <chr>, logo_2 <chr>, venue_id <int>, venue_name <chr>, city <chr>,
## #   state <chr>, zip <chr>, country_code <chr>, timezone <chr>, latitude <dbl>,
## #   longitude <dbl>, elevation <chr>, capacity <int>, year_constructed <int>,
## #   grass <lgl>, dome <lgl>
cfbd_team_info(year = 2019)
## ── Team information from CollegeFootballData.com ───────────── cfbfastR 1.9.0 ──
##  Data updated: 2022-06-15 19:53:26 UTC
## # A tibble: 130 × 27
##    team_id school   mascot abbreviation alt_name1 alt_name2 alt_name3 conference
##      <int> <chr>    <chr>  <chr>        <chr>     <chr>     <chr>     <chr>     
##  1    2005 Air For… Falco… AFA          NA        AFA       Air Force Mountain …
##  2    2006 Akron    Zips   AKR          NA        AKR       Akron     Mid-Ameri…
##  3     333 Alabama  Crims… ALA          NA        ALA       Alabama   SEC       
##  4    2026 Appalac… Mount… APP          NA        APP       Appalach… Sun Belt  
##  5      12 Arizona  Wildc… ARIZ         NA        ARIZ      Arizona   Pac-12    
##  6       9 Arizona… Sun D… ASU          NA        ASU       Arizona … Pac-12    
##  7       8 Arkansas Razor… ARK          NA        ARK       Arkansas  SEC       
##  8    2032 Arkansa… Red W… ARST         NA        ARST      Arkansas… Sun Belt  
##  9     349 Army     Black… ARMY         NA        ARMY      Army      FBS Indep…
## 10       2 Auburn   Tigers AUB          NA        AUB       Auburn    SEC       
## # … with 120 more rows, and 19 more variables: division <chr>, color <chr>,
## #   alt_color <chr>, logo <chr>, logo_2 <chr>, venue_id <int>,
## #   venue_name <chr>, city <chr>, state <chr>, zip <chr>, country_code <chr>,
## #   timezone <chr>, latitude <dbl>, longitude <dbl>, elevation <chr>,
## #   capacity <int>, year_constructed <int>, grass <lgl>, dome <lgl>

Get Team Matchup History (Total Record)

cfbd_team_matchup_records("Texas", "Oklahoma")
## ── Team matchup record from CollegeFootballData.com ────────── cfbfastR 1.9.0 ──
##  Data updated: 2022-06-15 19:53:26 UTC
## # A tibble: 1 × 7
##   start_year end_year team1 team1_wins team2    team2_wins ties 
##   <chr>      <chr>    <chr> <chr>      <chr>    <chr>      <chr>
## 1 ""         ""       Texas 59         Oklahoma 50         5
cfbd_team_matchup_records("Texas A&M", "TCU", min_year = 1975)
## ── Team matchup record from CollegeFootballData.com ────────── cfbfastR 1.9.0 ──
##  Data updated: 2022-06-15 19:53:26 UTC
## # A tibble: 1 × 7
##   start_year end_year team1     team1_wins team2 team2_wins ties 
##   <chr>      <chr>    <chr>     <chr>      <chr> <chr>      <chr>
## 1 1975       ""       Texas A&M 22         TCU   0          0

Get Team Matchup History

cfbd_team_matchup("Texas", "Oklahoma")
## 2022-06-15 19:53:26:Invalid arguments or no team matchup data available!
## data frame with 0 columns and 0 rows
cfbd_team_matchup("Texas A&M", "TCU")
## 2022-06-15 19:53:26:Invalid arguments or no team matchup data available!
## data frame with 0 columns and 0 rows
cfbd_team_matchup("Texas A&M", "TCU", min_year = 1975)
## 2022-06-15 19:53:27:Invalid arguments or no team matchup data available!
## data frame with 0 columns and 0 rows
cfbd_team_matchup("Florida State", "Florida", min_year = 1975)
## 2022-06-15 19:53:27:Invalid arguments or no team matchup data available!
## data frame with 0 columns and 0 rows

Get Team Rosters

cfbd_team_roster(year = 2013, team = "Florida State")
## ── Team roster data from CollegeFootballData.com ───────────── cfbfastR 1.9.0 ──
##  Data updated: 2022-06-15 19:53:27 UTC
## # A tibble: 55 × 17
##    athlete_id first_name last_name team      weight height jersey  year position
##    <chr>      <chr>      <chr>     <chr>      <int>  <int>  <int> <int> <chr>   
##  1 480772     Dan        Hicks     Florida …     NA     76      6    NA DE      
##  2 480781     Jacobbi    McDaniel  Florida …     NA     72     55    NA DT      
##  3 501075     Chad       Abram     Florida …     NA     72     41    NA FB      
##  4 501076     Terrence   Brooks    Florida …     NA     71     31    NA DB      
##  5 501077     Shayne     Broxsie   Florida …     NA     74     42    NA TE      
##  6 501082     Jarred     Haggins   Florida …     NA     72     12    NA WR      
##  7 501083     Christian  Jones     Florida …     NA     76      7    NA LB      
##  8 501084     Lamarcus   Joyner    Florida …     NA     68     20    NA DB      
##  9 501095     Telvin     Smith     Florida …     NA     75     22    NA LB      
## 10 501097     Nigel      Terrell   Florida …     NA     74     43    NA LB      
## # … with 45 more rows, and 8 more variables: home_city <chr>, home_state <chr>,
## #   home_country <chr>, home_latitude <chr>, home_longitude <chr>,
## #   home_county_fips <chr>, recruit_ids <list>, headshot_url <chr>

Get Team Talent

## ── 247sports team talent ratings from CollegeFootballData.com ──────────────────
##  Data updated: 2022-06-15 19:53:27 UTC
## # A tibble: 1,537 × 3
##     year school     talent
##    <int> <chr>       <dbl>
##  1  2021 Alabama     1004.
##  2  2021 Georgia     1002.
##  3  2021 Ohio State   985.
##  4  2021 Clemson      935.
##  5  2021 LSU          904.
##  6  2021 Oklahoma     895.
##  7  2021 Texas A&M    888.
##  8  2021 Oregon       886.
##  9  2021 Florida      886.
## 10  2021 USC          874.
## # … with 1,527 more rows
cfbd_team_talent(year = 2018)
## ── 247sports team talent ratings from CollegeFootballData.com ──────────────────
##  Data updated: 2022-06-15 19:53:27 UTC
## # A tibble: 237 × 3
##     year school        talent
##    <int> <chr>          <dbl>
##  1  2018 Ohio State      984.
##  2  2018 Alabama         979.
##  3  2018 Georgia         964 
##  4  2018 USC             934.
##  5  2018 Clemson         893.
##  6  2018 LSU             890.
##  7  2018 Florida State   889.
##  8  2018 Michigan        862.
##  9  2018 Texas           861.
## 10  2018 Notre Dame      848.
## # … with 227 more rows