Learn R Programming

NFLSimulatoR (version 0.4.0)

down_distance_updater: Update the down and distance of a drive

Description

The down and distance updater will run a play and update various game-based statistics accordingly.

Usage

down_distance_updater(
  what_down,
  yards_to_go,
  yards_from_own_goal,
  play_by_play_data,
  ...
)

Value

A data.frame object

Arguments

what_down

The current down (1st, 2nd, 3rd, or 4th down)

yards_to_go

Number of yards to go until a first down or TD

yards_from_own_goal

The number of yards from the possession team's own goal

play_by_play_data

A data file from nflscrapR prepped using the prep_pbp_data.R function

...

Additional arguments for different strategies

Examples

Run this code
if (FALSE) {
down_distance_updater(what_down = 1,
                      yards_to_go = 10,
                      yards_from_own_goal = 25,
                      play_by_play_data = pbp_data,
                      strategy = "normal")
} 

Run the code above in your browser using DataLab