Learn R Programming

NFLSimulatoR (version 0.4.0)

expected_pts_fourth: Decision for 4th downs based on expected points

Description

This function will return the expected points for several 4th down decision. The options are "go for it", "field goal", or "punt". This should be primarily used within the `NFLSimulatoR::sample_play()` function.

Usage

expected_pts_fourth(yards_from_goal, yards_to_go, play_data)

Value

A data.frame of the expected points of three fourth down options

Arguments

yards_from_goal

The number of yards until a team scores a touchdown

yards_to_go

Number of yards to go until a first down or TD

play_data

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

Examples

Run this code
if (FALSE) {
expected_pts_fourth(what_down = 1,
                      yards_to_go = 10,
                      yards_from_own_goal = 25,
                      play_by_play_data = reg_pbp_2018)
}

Run the code above in your browser using DataLab