sample_drives: Sample a Series of Drives, a strategy to test verses the normal strategy
Description
Sample a Series of Drives, a strategy to test verses the normal strategy
Usage
sample_drives(
n_sims,
from_yard_line = 25,
play_by_play_data,
strategy = "normal",
single_drive = FALSE,
progress = TRUE,
...
)
Value
A data.frame of drives
Arguments
- n_sims
The number of simulations
- from_yard_line
The starting field position (defaults to 25)
- play_by_play_data
A data file from nflscrapR prepped using the prep_pbp_data.R function
- strategy
"normal", "passes_rushes", or "fourth_downs"
- single_drive
TRUE indicates only a single drive, otherwise, drives sampled until a score occurs
- progress
logical for inclusion of a progress bar
- ...
Additional arguments for different strategies
Examples
Run this codeif (FALSE) {
sample_drives(2, 25, dt)
}
Run the code above in your browser using DataLab