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")
## Warning in p_install_gh(package, dependencies = dependencies, ...): The following may have incorrect capitalization specification:
## 
## cfbfastR

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: 2023-03-23 02:33:38 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: 2023-03-23 02:33:38 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