Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sportsdataverse/cfbfastR

An R package to quickly obtain clean and tidy college football play by play data
https://github.com/sportsdataverse/cfbfastR

cfb-data college-football college-football-players collegefootballdata-api espn football football-api football-data football-scores footballdata ncaaf r rstats sports sports-analytics sports-betting sports-data sports-stats sportsanalytics sportsdataverse

Last synced: 3 months ago
JSON representation

An R package to quickly obtain clean and tidy college football play by play data

Awesome Lists containing this project

README

        

---
output: github_document
---

#

# **cfbfastR**
```{r, include = FALSE}
require(knitr)
if (!requireNamespace('issue') & !requireNamespace('pacman')){
install.packages('pacman')
}
pacman::p_load(magick, grid, dplyr, lubridate)

```

[![CRAN version](https://img.shields.io/badge/dynamic/json?style=for-the-badge&color=success&label=CRAN%20version&prefix=v&query=%24.Version&url=https%3A%2F%2Fcrandb.r-pkg.org%2FcfbfastR)](https://CRAN.R-project.org/package=cfbfastR)
[![CRAN downloads](https://img.shields.io/badge/dynamic/json?style=for-the-badge&color=success&label=Downloads&query=%24%5B0%5D.downloads&url=https%3A%2F%2Fcranlogs.r-pkg.org%2Fdownloads%2Ftotal%2F2021-10-26%3Alast-day%2FcfbfastR)](https://CRAN.R-project.org/package=cfbfastR)
[![Version-Number](https://img.shields.io/github/r-package/v/sportsdataverse/cfbfastR?label=cfbfastR&logo=R&style=for-the-badge)](https://github.com/sportsdataverse/cfbfastR/)
[![R-CMD-check](https://img.shields.io/github/actions/workflow/status/sportsdataverse/cfbfastR/R-CMD-check.yaml?branch=main&label=R-CMD-Check&logo=R&logoColor=white&style=for-the-badge)](https://github.com/sportsdataverse/cfbfastR/actions/workflows/R-CMD-check.yaml) [![Lifecycle:maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg?style=for-the-badge&logo=github)](https://github.com/sportsdataverse/cfbfastR/) [![Contributors](https://img.shields.io/github/contributors/sportsdataverse/cfbfastR?style=for-the-badge)](https://github.com/sportsdataverse/cfbfastR/graphs/contributors) [![Twitter Follow](https://img.shields.io/twitter/follow/cfbfastR?color=blue&label=%40cfbfastR&logo=twitter&style=for-the-badge)](https://twitter.com/cfbfastR) [![Twitter Follow](https://img.shields.io/twitter/follow/SportsDataverse?color=blue&label=%40SportsDataverse&logo=twitter&style=for-the-badge)](https://twitter.com/SportsDataverse)

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

## **Installation**

You can install the CRAN version of [**```cfbfastR```** ](https://CRAN.R-project.org/package=cfbfastR) with:
```r
install.packages("cfbfastR")
```

You can install the released version of [**```cfbfastR```**](https://github.com/sportsdataverse/cfbfastR/) from [GitHub](https://github.com/sportsdataverse/cfbfastR) with:

```r
# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
install.packages('pacman')
}
pacman::p_load_current_gh("sportsdataverse/cfbfastR", dependencies = TRUE, update = TRUE)
```

## **Breaking Changes**

[**Full News on Releases**](https://cfbfastR.sportsdataverse.org/news/index.html)

#### **College Football Data API Keys**

The [CollegeFootballData API](https://collegefootballdata.com/) now requires an API key, here's a quick run-down:

* To get an API key, follow the directions here: [College Football Data Key Registration.](https://collegefootballdata.com/key)

* Using the key: You can save the key for consistent usage by adding `CFBD_API_KEY=YOUR-API-KEY-HERE` to your .Renviron file (easily accessed via [**`usethis::edit_r_environ()`**](https://usethis.r-lib.org/reference/edit.html)). Run [**`usethis::edit_r_environ()`**](https://usethis.r-lib.org/reference/edit.html), a new script will pop open named `.Renviron`, **THEN** paste the following in the new script that pops up (with**out** quotations)
```r
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.

```{r}
Sys.setenv(CFBD_API_KEY = "YOUR-API-KEY-HERE")
```

## Follow [cfbfastR](https://twitter.com/cfbfastR) and the [SportsDataverse](https://twitter.com/SportsDataverse) on Twitter and star this repo

[![Twitter Follow](https://img.shields.io/twitter/follow/cfbfastR?color=blue&label=%40cfbfastR&logo=twitter&style=for-the-badge)](https://twitter.com/cfbfastR)
[![Twitter Follow](https://img.shields.io/twitter/follow/SportsDataverse?color=blue&label=%40SportsDataverse&logo=twitter&style=for-the-badge)](https://twitter.com/SportsDataverse)

[![GitHub stars](https://img.shields.io/github/stars/sportsdataverse/cfbfastR.svg?color=eee&logo=github&style=for-the-badge&label=Star%20cfbfastR&maxAge=2592000)](https://github.com/sportsdataverse/cfbfastR/stargazers/)

## **Our Authors**

- [Saiem Gilani](https://twitter.com/saiemgilani)
@saiemgilani
@saiemgilani

- [Akshay Easwaran](https://twitter.com/akeaswaran)
@akeaswaran
@akeaswaran

- [Jared Lee](https://twitter.com/JaredDLee)
@JaredDLee
@Kazink36

- [Eric Hess](https://twitter.com/arbitanalytics)
@arbitanalytics
@ehess

# **Our Contributors (they're awesome)**

- [Nate Manzo](https://twitter.com/cfbnate)
@cfbnate
@natemanzo

- [Michael Egle](https://twitter.com/deceptivespeed_)
@deceptivespeed_
@michaelegle

- [Jason DeLoach](https://twitter.com/CFBNumbers)
@CFBNumbers
@CFBNumbers

- [Tej Seth](https://twitter.com/Tejseth41)
@Tejseth41
@tejseth

- [Conor McQuiston](https://twitter.com/ConorMcQ5)
@ConorMcQ5
@mcqconor

- [Tan Ho](https://twitter.com/_TanHo)
@_TanHo
@tanho63

- [Keegan Abdoo](https://twitter.com/KeeganAbdoo)
@KeeganAbdoo
@keegan-abdoo

- [Matt Spencer](https://twitter.com/Maatspencer)
@Maatspencer
@Maatspencer

- [Sebastian Carl](https://twitter.com/mrcaseb)
@mrcaseb
@mrcaseb

- [John Edwards](https://twitter.com/John_B_Edwards)
@John_B_Edwards
@john-b-edwards

# **Authors Emeritus - `cfbscrapR`[archived]**

- [Meyappan Subbiah](https://twitter.com/msubbaiah1)
@msubbaiah1
@meysubb

- [Parker Fleming](https://twitter.com/statsowar)
@statsowar
@spfleming

# **Special Thanks**

- [Nick Tice](https://github.com/NickTice)

## **Citations**

To cite the [**`cfbfastR`**](https://cfbfastR.sportsdataverse.org/) R package in publications, use:

BibTex Citation
```bibtex
@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}
}
```