26 open-source packages · R · Python · Node.js · 8 leagues in the warehouse · 120M+ rows of play-by-play · EPA · win probability · ratings models · free and open since 2021

{cfbfastR}: Tidying College Football Play-by-Play Data

Saiem Gilani

Saiem GilaniMay 10, 2021

4 min read706 words

cfbfastR

CRAN
version CRAN
downloads Version-Number R-CMD-check Lifecycle:maturing Contributors Twitter
Follow Twitter
Follow

The goal of cfbfastR is to provide the community with an R package for working with CFB data. It is an R API wrapper around https://collegefootballdata.com/. Beyond data aggregation and tidying ease, one of the multitude of services that cfbfastR provides is for benchmarking open-source expected points and win probability metrics.

Installation

You can install the CRAN version of cfbfastR with:

install.packages("cfbfastR")

You can install the released version of cfbfastR from GitHub with:

# You can install the development version from GitHub with remotes:
if (!requireNamespace('remotes', quietly = TRUE)){
  install.packages('remotes', repos = "https://cloud.r-project.org")
}
remotes::install_github("sportsdataverse/cfbfastR")

Breaking Changes

Full News on Releases

College Football Data API Keys

The CollegeFootballData API now requires an API key, here’s a quick run-down:

CFBD_API_KEY = YOUR-API-KEY-HERE

Save the script and restart your RStudio session, by clicking Session (in between Plots and Build) and click Restart R (there also exists the shortcut Ctrl + Shift + F10 to restart your session). If set correctly, from then on you should be able to use any of the cfbd_ functions without any other changes.

  • For less consistent usage: At the beginning of every session or within an R environment, save your API key as the environment variable CFBD_API_KEY (with quotations) using a command like the following.
Sys.setenv(CFBD_API_KEY = "YOUR-API-KEY-HERE")

Proxy support

If you run cfbfastR from behind a corporate proxy, set it once per session and every cfbd_*() / espn_cfb_*() call routes through it:

options(cfbfastR.proxy = "http://proxy.host.example:8080")
# or, for an authenticated proxy:
options(cfbfastR.proxy = list(
  url = "http://proxy.host.example", port = 8080,
  username = "me", password = "pw", auth = "basic"
))

The resolution order is: explicit proxy = argument → getOption("cfbfastR.proxy")http_proxy / https_proxy environment variables.

Follow cfbfastR and the SportsDataverse on Twitter and star this repo

Twitter
Follow Twitter
Follow

GitHub
stars

Our Authors

Our Contributors (they’re awesome)

Authors Emeritus - cfbscrapR[archived]

Special Thanks

Citations

To cite the cfbfastR R package in publications, use:

BibTex Citation

@misc{gilani_et_al_2021_cfbfastr,
  author = {Saiem Gilani and Akshay Easwaran and Jared Lee and Eric Hess},
  title = {cfbfastR: The SportsDataverse's R Package for College Football Data.},
  url = {https://cfbfastR.sportsdataverse.org/},
  year = {2021}
}

Share this post: