README.md

tidyCFL

A tidy data package for the Canadian Football League API

API info

An API key is required and can be requested here.

Documentation for the CFL API can be found here.

Config

set the API key with tidyCFL.api_key('YOUR API KEY')

Usage

library(tidyCFL)
library(dplyr)

tidyCFL.api_key('testK3Y')
games2016 <- cfl_games(2016)

# Order games by point spread
games2016 %>%
  mutate(point_diff = abs(away_score-home_score)) %>%
  arrange(desc(point_diff))


# Information for a single player. 
# Takes the CFL Player ID as an argument
player_id <- 138985
player1 <- cfl_players(player_id)

# Play by play
pbp <- cfl_plays(season = 2016, game_id = 2280)




andrewjdyck/tidyCFL documentation built on Jan. 3, 2022, 12:41 p.m.