Skip to contents

Load and Install Packages

if (!requireNamespace('pak', quietly = TRUE)){
  install.packages('pak')
}
pak::pak(c("dplyr", "tidyr", "gt", "cfbfastR"))
##  Loading metadata database
##  Loading metadata database ... done
## 
## 
## → Package library at /home/runner/work/_temp/Library.
## → Will install 1 system package:
## + libnode-dev  - V8
##  No downloads are needed
##  Installing system requirements
##  Executing `sudo sh -c apt-get -y update`
## Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [144 B]
## Hit:6 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease
## Hit:7 https://dl.google.com/linux/chrome-stable/deb stable InRelease
## Hit:2 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
## Hit:3 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease
## Hit:4 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease
## Hit:5 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease
## Reading package lists...
##  Executing `sudo sh -c apt-get -y install libicu-dev libcurl4-openssl-dev libssl-dev cmake make libuv1-dev pandoc libnode-dev libxml2-dev`
## Reading package lists...
## Building dependency tree...
## Reading state information...
## libicu-dev is already the newest version (70.1-2).
## make is already the newest version (4.3-4.1build1).
## pandoc is already the newest version (2.9.2.1-3ubuntu2).
## cmake is already the newest version (3.22.1-1ubuntu1.22.04.2).
## libcurl4-openssl-dev is already the newest version (7.81.0-1ubuntu1.27).
## libssl-dev is already the newest version (3.0.2-0ubuntu1.29).
## libuv1-dev is already the newest version (1.43.0-1ubuntu0.1).
## libxml2-dev is already the newest version (2.9.13+dfsg-1ubuntu0.12).
## The following additional packages will be installed:
## libnode72
## The following NEW packages will be installed:
## libnode-dev libnode72
## 0 upgraded, 2 newly installed, 0 to remove and 34 not upgraded.
## Need to get 11.4 MB of archives.
## After this operation, 47.4 MB of additional disk space will be used.
## Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [144 B]
## Get:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libnode72 amd64 12.22.9~dfsg-1ubuntu3.6 [10.8 MB]
## Get:3 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libnode-dev amd64 12.22.9~dfsg-1ubuntu3.6 [609 kB]
## Fetched 11.4 MB in 0s (82.8 MB/s)
## Selecting previously unselected package libnode72:amd64.
## (Reading database ...
## (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%
## (Reading database ... 60%
## (Reading database ... 65%
## (Reading database ... 70%
## (Reading database ... 75%
## (Reading database ... 80%
## (Reading database ... 85%
## (Reading database ... 90%
## (Reading database ... 95%
## (Reading database ... 100%(Reading database ... 308163 files and directories currently installed.)
## Preparing to unpack .../libnode72_12.22.9~dfsg-1ubuntu3.6_amd64.deb ...
## Unpacking libnode72:amd64 (12.22.9~dfsg-1ubuntu3.6) ...
## Selecting previously unselected package libnode-dev.
## Preparing to unpack .../libnode-dev_12.22.9~dfsg-1ubuntu3.6_amd64.deb ...
## Unpacking libnode-dev (12.22.9~dfsg-1ubuntu3.6) ...
## Setting up libnode72:amd64 (12.22.9~dfsg-1ubuntu3.6) ...
## Setting up libnode-dev (12.22.9~dfsg-1ubuntu3.6) ...
## Processing triggers for libc-bin (2.35-0ubuntu3.14) ...
## Running kernel seems to be up-to-date.
## 
## No services need to be restarted.
## 
## No containers need to be restarted.
## 
## No user sessions are running outdated binaries.
## No VM guests are running outdated hypervisor (qemu) binaries on this host.
##  4 pkgs + 72 deps: kept 72 [13.4s]
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
library(gt)
library(cfbfastR)
# pak::pak("sportsdataverse/cfbfastR")

Get Betting information from games

cfbd_betting_lines(year = 2018, week = 12, team = "Florida State")
## ── Betting lines data from CollegeFootballData.com ─────────── cfbfastR 3.0.0 ──
##  Data updated: 2026-09-07 09:27:12 UTC
## # A tibble: 4 × 23
##     game_id season season_type  week start_date           home_team_id home_team
##       <int>  <int> <chr>       <int> <chr>                       <int> <chr>    
## 1 401013175   2018 regular        12 2018-11-17T20:30:00…           52 Florida …
## 2 401013175   2018 regular        12 2018-11-17T20:30:00…           52 Florida …
## 3 401013175   2018 regular        12 2018-11-17T20:30:00…           52 Florida …
## 4 401013175   2018 regular        12 2018-11-17T20:30:00…           52 Florida …
## # ℹ 16 more variables: home_conference <chr>, home_classification <chr>,
## #   home_score <int>, away_team_id <int>, away_team <chr>,
## #   away_conference <chr>, away_classification <chr>, away_score <int>,
## #   provider <chr>, spread <dbl>, formatted_spread <chr>, spread_open <lgl>,
## #   over_under <dbl>, 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 3.0.0 ──
##  Data updated: 2026-09-07 09:27:12 UTC
## # A tibble: 4 × 23
##     game_id season season_type  week start_date           home_team_id home_team
##       <int>  <int> <chr>       <int> <chr>                       <int> <chr>    
## 1 401012356   2018 regular        13 2018-11-25T00:30:00…          245 Texas A&M
## 2 401012356   2018 regular        13 2018-11-25T00:30:00…          245 Texas A&M
## 3 401012356   2018 regular        13 2018-11-25T00:30:00…          245 Texas A&M
## 4 401012356   2018 regular        13 2018-11-25T00:30:00…          245 Texas A&M
## # ℹ 16 more variables: home_conference <chr>, home_classification <chr>,
## #   home_score <int>, away_team_id <int>, away_team <chr>,
## #   away_conference <chr>, away_classification <chr>, away_score <int>,
## #   provider <chr>, spread <int>, formatted_spread <chr>, spread_open <lgl>,
## #   over_under <dbl>, over_under_open <lgl>, home_moneyline <lgl>,
## #   away_moneyline <lgl>

Our Authors

Citation

To cite the cfbfastR R package in publications, use:

BibTeX Citation

@misc{cfbfastr,
  author = {Saiem Gilani and Akshay Easwaran and Jared Lee and Eric Hess},
  title = {cfbfastR: Access College Football Play by Play Data},
  url = {https://cfbfastR.sportsdataverse.org/},
  year = {2021}
}