Skip to contents

Load and Install Packages

if (!requireNamespace('pacman', quietly = TRUE)){
  install.packages('pacman')
}
pacman::p_load(dplyr,tidyr, gt)
## Installing package into '/home/runner/work/_temp/Library'
## (as 'lib' is unspecified)
## also installing the dependencies 'V8', 'bigD', 'bitops', 'juicyjuice'
## 
## gt installed
pacman::p_load_current_gh("sportsdataverse/cfbfastR")
## 
## * checking for file ‘/tmp/Rtmp7zr8jf/remotes84c4e1308b0/sportsdataverse-cfbfastR-711efbc/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.3.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.3 ──
##  Data updated: 2022-11-24 08:48:21 UTC
## # A tibble: 4 × 19
##     game_id season seaso…¹  week start…² home_…³ home_…⁴ home_…⁵ away_…⁶ away_…⁷
##       <int>  <int> <chr>   <int> <chr>   <chr>   <chr>     <int> <chr>   <chr>  
## 1 401013175   2018 regular    12 2018-1… Florid… ACC          22 Boston… ACC    
## 2 401013175   2018 regular    12 2018-1… Florid… ACC          22 Boston… ACC    
## 3 401013175   2018 regular    12 2018-1… Florid… ACC          22 Boston… ACC    
## 4 401013175   2018 regular    12 2018-1… Florid… ACC          22 Boston… ACC    
## # … with 9 more variables: 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>, and
## #   abbreviated variable names ¹​season_type, ²​start_date, ³​home_team,
## #   ⁴​home_conference, ⁵​home_score, ⁶​away_team, ⁷​away_conference
# 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.3 ──
##  Data updated: 2022-11-24 08:48:21 UTC
## # A tibble: 4 × 19
##     game_id season seaso…¹  week start…² home_…³ home_…⁴ home_…⁵ away_…⁶ away_…⁷
##       <int>  <int> <chr>   <int> <chr>   <chr>   <chr>     <int> <chr>   <chr>  
## 1 401012356   2018 regular    13 2018-1… Texas … SEC          74 LSU     SEC    
## 2 401012356   2018 regular    13 2018-1… Texas … SEC          74 LSU     SEC    
## 3 401012356   2018 regular    13 2018-1… Texas … SEC          74 LSU     SEC    
## 4 401012356   2018 regular    13 2018-1… Texas … SEC          74 LSU     SEC    
## # … with 9 more variables: 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>, and
## #   abbreviated variable names ¹​season_type, ²​start_date, ³​home_team,
## #   ⁴​home_conference, ⁵​home_score, ⁶​away_team, ⁷​away_conference