nflfastR 4.6.0
New Features
- nflfastR now fully supports loading raw pbp data from local file system. The best way to use this feature is to set
options("nflfastR.raw_directory" = {"your/local/directory"}). Alternatively, bothbuild_nflfastR_pbp()andfast_scraper()support the argumentdirwhich defaults to the above option. (#423) - Added the new function
save_raw_pbp()which efficiently downloads raw play-by-play data and saves it to the local file system. This serves as a helper to setup the system for faster play-by-play parsing via the above functionality. (#423) - Added the new function
missing_raw_pbp()that computes a vector of game IDs missing in the local raw play-by-play directory. (#423)
Minor Improvements and Bugfixes
- The internal function
get_pbp_nfl()now usesifelse()instead ofdplyr::if_else()to handle some null-checking, fixes bug found in2022_21_CIN_KCmatch. - The function
calculate_player_stats()now summarises target share and air yards share correctly when called with argumentweekly = FALSE(#413) - The function
calculate_player_stats()now returns the opponent team when called with argumentweekly = TRUE(#414) - The function
calculate_player_stats_def()no longer errors when small subsets of pbp data are missing stats. (#415) - The function
calculate_series_conversion_rates()no longer returnsNAvalues if a small subset of pbp data is missing series on offense or defense. (#417) fixed_drivenow correctly increments on plays where posteam lost a fumble but remains posteam because defteam also lost a fumble during the same play. (#419)- nflfastR now fixes missing drive number counts in raw pbp data in order to provide accurate drive information. (#420)
- nflfastR now returns correct
kick_distanceon all punts and kickoffs. (#422) - Decode player IDs in 2023 pbp. (#425)
- Drop the pseudo plays TV Timeout and Two-Minute Warning. (#426)
- Fix posteam on kickoffs and PATs following a defensive TD in 2023+ pbp. (#427)
calculate_player_stats()no more counts lost fumbles on plays where a player fumbles, a team mate recovers and then loses a fumble to the defense. (#431)- The variables
passer,receiver, andrusherno more returnNAon "abnormal" plays - like direct snaps, aborted snaps, laterals etc. - that resulted in a penalty. (#435)
Thank you to
@903124, @ak47twq, @andrewtek, @darkhark, @dennisbrookner, @marvin3FF, @mistakia, @mrcaseb, @nicholasmendoza22, @rickstarblazer, @RileyJohnson22, and @tanho63 for their questions, feedback, and contributions towards this release.