Added all new cfbd_*() functions accommodated by the
new College Football Data API v2. This includes the following
functions:
cfbd_metrics_fg_ep()
function to access the new field goal expected points added metric from
the API.cfbd_metrics_wepa_team_season()
function to access the new opponent adjusted team season predicted
points added metric from the API.cfbd_metrics_wepa_players_passing()
function to access the new opponent adjusted players passing predicted
points added metric from the API.cfbd_metrics_wepa_players_rushing()
function to access the new opponent adjusted players rushing predicted
points added metric from the API.cfbd_metrics_wepa_players_kicking()
function to access the new Points Added Above Replacement (PAAR) ratings
for kickers from the API.cfbd_ratings_fpi()
function to access the new FPI ratings from the API.cfbd_live_scoreboard()
function to access live scoreboard data from the API.cfbd_live_plays()
function to access live play-by-play data from the API.cfbd_api_key_info()
function to get information about your API key, including your Patreon
level and usage limits.Minor changes to the existing cfbd_*() functions
under the hood to accommodate the new API v2 structure. Please see below
for a list of all updated functions:
cfbd_betting_lines()
functioncfbd_coaches()
functioncfbd_conferences()
functioncfbd_drives()
functioncfbd_calendar()
functioncfbd_game_box_advanced()
functioncfbd_game_info()
functioncfbd_game_media()
functioncfbd_game_player_stats()
functioncfbd_game_records()
functioncfbd_game_team_stats()
functioncfbd_metrics_ppa_games()
functioncfbd_metrics_ppa_players_games()
functioncfbd_metrics_ppa_players_season()
functioncfbd_metrics_ppa_predicted()
functioncfbd_metrics_ppa_teams()
functioncfbd_metrics_wp()
functioncfbd_metrics_wp_pregame()
functioncfbd_pbp_data()
functioncfbd_play_stats_player()
functioncfbd_play_stats_types()
functioncfbd_play_types()
functioncfbd_plays()
functioncfbd_player_info()
functioncfbd_player_returning()
functioncfbd_player_usage()
functioncfbd_rankings()
functioncfbd_ratings_sp()
functioncfbd_ratings_sp_conference()
functioncfbd_ratings_srs()
functioncfbd_recruiting_player()
functioncfbd_recruiting_position()
functioncfbd_recruiting_team()
functioncfbd_stats_categories()
functioncfbd_stats_game_advanced()
functioncfbd_stats_season_advanced()
functioncfbd_stats_season_player()
functioncfbd_stats_season_team()
functioncfbd_team_info()
functioncfbd_team_matchup()
functioncfbd_team_matchup_records()
functioncfbd_team_roster()
functioncfbd_team_talent()
functioncfbd_venues()
functionAll load_cfb_*() functions now use sportsdataverse-data
releases or the CollegeFootballData.com
API as their underlying data source to remain in compliance with
CFBD API terms and conditions.
Fixed the following functions and/or documentation:
cfbd_team_info()
addressing #97cfbd_stats_game_advanced()
returns an empty data frame when there are no resultscfbd_game_team_stats()
updated to reflect all parameter requirement scenarios.athlete_id parameter cfbd_player_usage()
so that it works as users would expect. There was an API query-parameter
mismatchathlete_id parameter for cfbd_play_stats_player()
function and added more thorough documentation.position to correct value (instead of
NA) from cfbd_stats_season_player()season_type parameter documentation
across many functionscfbd_pbp_data()
to substitute 3 timeouts per half when the data is missing from the
API.stringi v1.8 update in cfbd_play_pbp_data()
EPA and WPA processingespn_cfb_scoreboard()
and espn_cfb_schedule()
functions while adding lubridate dependencyespn_ratings_fpi()
functionespn_cfb_player_stats()
function added.cfbd_game_team_stats() function return data in a long
formatespn_cfb_calendar()espn_cfb_schedule()espn_cfb_pbp()espn_cfb_team_stats()Removes furrr, future dependencies,
adds Rcpp, RcppParallel, and
purrr dependencies
espn_ratings_fpi()
to exports.cfbd_game_team_stats() with _allowed
columns duplicating team stats instead of showing opponent stats.cfbd_game_team_stats().cfbd_pbp_data() to account for
additional timeout cases (namely, kickoffs/extra point attempts).cfbd_betting_lines()espn_ratings_fpi() now requires headers in
httr requestcfbd_ratings_elo()
functionupdate_cfb_db() where the function
failed when trying to load recent games from the data repo. (#35)cfbfastR.dbdirectory that allows to
set the database directory in update_cfb_db()
globally.cfbd_stats_season_team() that were not behaving
correctlyonly_fbs input in
cfbd_team_info() was ignored. It is now possible to get the
team info for all the colleges in the API instead of only FBS
schools.cfbd_metrics_ppa_teams.
cfbd_metrics_ppa_teams and
cfbd_metrics_ppa_players_season now require one of
team or year to be specifiedespn_cfb_scoreboard()espn_cfb_pbp()cfbd_game_weather()cfbd_game_player_stats()cfbd_recruiting_players()cfbd_draft_teams()
- Get list of NFL teamscfbd_draft_positions()
- Get list of NFL positions for mapping to
collegiatecfbd_draft_picks()
- Get list of NFL Draft picksAdded headshot_url to outputs of cfbd_team_roster()
Renamed returns in cfbd_game_box_advanced():
rushing_line_yd_avg to plural
rushing_line_yds_avgrushing_second_lvl_yd_avg to plural
rushing_second_lvl_yds_avgrushing_open_field_yd_avg to plural
rushing_open_field_yds_avgCompleted documentation for all returns except
cfbd_pbp_data()
Continued work on intro vignette
id variable to team_id in espn_ratings_fpi()espn_game_id variable to game_id
in espn_metrics_wp(),
corrected the away_win_percentage calculation and added
tie_percentage to the returns.id variable to athlete_id in cfbd_metrics_ppa_players_season()load_cfb_pbp()
and update_cfb_db()
functions. Pretty much cherry-picking the nflfastR
methodology of loading data from the cfbfastR-data
repository.furrr,
future, and
progressr
dependencies to the package to allow for parallel processing of the
play-by-play data with progress updates if desired.All functions sourced from the College Football Data API will
start with cfbd_ as opposed to cfb_ (as in
cfbscrapR). One additional cfbd_ function has been added
that corresponds to the result when cfbd_pbp_data()
has the parameter epa_wpa=FALSE. It has now been separated
into its own function for clarity cfbd_plays().
The parameter and functionality still exists in cfbd_pbp_data()
but we expect this function will still exist but made obsolete in favor
of a function more closely matching nflfastR’s naming
conventions.
Similarly, data and metrics sourced from ESPN will begin with
espn_ as opposed to cfb_. In particular, the
two functions are now espn_ratings_fpi()
and espn_metrics_wp()
Data generated from any of the cfbfastR methods will
use cfb_
The CollegeFootballData API 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.
Using the key: You can save the key for consistent usage by
adding CFBD_API_KEY=XXXX-YOUR-API-KEY-HERE-XXXXX to your
.Renviron file (easily accessed via usethis::edit_r_environ()).
Run usethis::edit_r_environ(),
a new script will pop open named .Renviron,
THEN paste the following in the new script that pops up
(without quotations)
CFBD_API_KEY = XXXX-YOUR-API-KEY-HERE-XXXXXSave the script and restart your RStudio session, by clicking
Session (in between Plots and
Build) and click Restart R (n.b. 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.
CFBD_API_KEY (with quotations) using a command like the
following.Sys.setenv(CFBD_API_KEY = "XXXX-YOUR-API-KEY-HERE-XXXXX")