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")
## cpp11 (0.4.7 -> 0.5.0) [CRAN]
## ── R CMD build ─────────────────────────────────────────────────────────────────
## * checking for file ‘/tmp/RtmphRONpx/remotes4c6358755a5b/sportsdataverse-cfbfastR-0ef93da/DESCRIPTION’ ... OK
## * preparing ‘cfbfastR’:
## * checking DESCRIPTION meta-information ... OK
## * checking for LF line-endings in source and make files and shell scripts
## * checking for empty or unneeded directories
## * building ‘cfbfastR_1.9.5.tar.gz’

Get Betting information from games

cfbd_betting_lines(year = 2018, week = 12, team = "Florida State")
## ── Betting lines data from CollegeFootballData.com ─────────── cfbfastR 1.9.5 ──
##  Data updated: 2024-09-10 01:25:35 UTC
## # A tibble: 4 × 19
##     game_id season season_type  week start_date        home_team home_conference
##       <int>  <int> <chr>       <int> <chr>             <chr>     <chr>          
## 1 401013175   2018 regular        12 2018-11-17T20:30… Florida … ACC            
## 2 401013175   2018 regular        12 2018-11-17T20:30… Florida … ACC            
## 3 401013175   2018 regular        12 2018-11-17T20:30… Florida … ACC            
## 4 401013175   2018 regular        12 2018-11-17T20:30… Florida … ACC            
## # ℹ 12 more variables: home_score <int>, away_team <chr>,
## #   away_conference <chr>, away_score <int>, provider <chr>, spread <chr>,
## #   formatted_spread <chr>, spread_open <lgl>, over_under <chr>,
## #   over_under_open <lgl>, home_moneyline <lgl>, away_moneyline <lgl>
# 7 OTs LSU at TAMU
cfbd_betting_lines(year = 2018, week = 13, team = "Texas A&M", conference = "SEC")
## ── Betting lines data from CollegeFootballData.com ─────────── cfbfastR 1.9.5 ──
##  Data updated: 2024-09-10 01:25:35 UTC
## # A tibble: 4 × 19
##     game_id season season_type  week start_date        home_team home_conference
##       <int>  <int> <chr>       <int> <chr>             <chr>     <chr>          
## 1 401012356   2018 regular        13 2018-11-25T00:30… Texas A&M SEC            
## 2 401012356   2018 regular        13 2018-11-25T00:30… Texas A&M SEC            
## 3 401012356   2018 regular        13 2018-11-25T00:30… Texas A&M SEC            
## 4 401012356   2018 regular        13 2018-11-25T00:30… Texas A&M SEC            
## # ℹ 12 more variables: home_score <int>, away_team <chr>,
## #   away_conference <chr>, away_score <int>, provider <chr>, spread <chr>,
## #   formatted_spread <chr>, spread_open <lgl>, over_under <chr>,
## #   over_under_open <lgl>, home_moneyline <lgl>, away_moneyline <lgl>