Learn R Programming

NFLSimulatoR

Simulating plays and drives in the NFL using nflscrapR or nflfastR data.

Website

The NFLSimulatoR package website is hosted at https://datacolorado.com/r/NFLSimulatoR.

Overview

The intent of NFLSimulatoR (version 0.1.0) is to enable the simulation of plays/drives and evaluate game-play strategies in the National Football League (NFL). Built-in strategies include going for it on fourth down and varying the proportion of passing/rushing plays during a drive. The user should be familiar with nflscrapR data before trying to write his/her own strategies. The package itself is inspired by a blog post by Mike Lopez, currently the Director of Data and Analytics at the NFL.

Getting Started

If you are just getting started with NFLSimulatoR, we recommend reading an upcoming paper related to use cases.

Installation Instructions

From CRAN (v0.3.0):

install.packages("NFLSimulatoR")

The latest developmental version from GitHub (v0.3.1):

install.packages("remotes")
remotes::install_github("rtelmore/NFLSimulatoR")

Resources

  • Open an issue (GitHub issues for bug reports, feature requests, etc.)

Copy Link

Version

Install

install.packages('NFLSimulatoR')

Monthly Downloads

268

Version

0.4.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Ryan Elmore

Last Published

August 19th, 2022

Functions in NFLSimulatoR (0.4.0)

sample_play

Sample one NFL play according to some strategy
sample_drives

Sample a Series of Drives, a strategy to test verses the normal strategy
prep_pbp_data

Add necessary columns to nflscrapR data
sample_fourth_down_strategy

Sample NFL play-by-play data with a specified 4th down strategy
expected_pts_fourth

Decision for 4th downs based on expected points
down_distance_updater

Update the down and distance of a drive
sample_passes_rushes_strategy

Sample NFL play-by-play data with a specified blend of rushing and passing