nflfastR is a set of functions to efficiently scrape NFL play-by-play data.
nflfastR expands upon the features of nflscrapR:
cp) and completion percentage over expected (
cpoe) in play-by-play going back to 2006
We owe a debt of gratitude to the original
nflscrapR team, Maksim Horowitz, Ronald Yurko, and Samuel Ventura, without whose contributions and inspiration this package would not exist.
You can load and install nflfastR from GitHub with:
# If 'devtools' isn't installed run # install.packages("devtools") devtools::install_github("mrcaseb/nflfastR")
We have provided some application examples under
vignette("examples"). However, these require a basic knowledge of R. For this reason we have the nflfastR beginner’s guide in
vignette("beginners_guide"), which we recommend to all those who are looking for an introduction to nflfastR with R.
nflfastR is very fast, for historical games we recommend downloading the data from here. These data sets include play-by-play data of complete seasons going back to 1999 and we will update them in 2020 once the season starts. The files contain both regular season and postseason data, and one can use game_type or week to figure out which games occurred in the postseason. Data are available as .csv.gz, .parquet, or .rds.
nflfastR uses its own models for Expected Points, Win Probability, and Completion Probability. To read about the models, please see
vignette("nflfastR-models"). For a more detailed description of Expected Points models, we highly recommend this paper from the nflscrapR team located here.
nflfastR includes two win probability models: one with and one without incorporating the pre-game spread.
nflfastRuses this source for 1999-2010)
nflscrapRteam, Maksim Horowitz, Ronald Yurko, and Samuel Ventura, whose work represented a dramatic step forward for the state of public NFL research