create_percentage_replacement_fn: Creates function to find percentage based replacement level...

Description Usage Arguments Value Examples

Description

Creates function to find percentage based replacement level QBs

Usage

1
create_percentage_replacement_fn(attempt_type, attempt_percent)

Arguments

attempt_type

String indicating which type of attempts to use from the table to use for the percent cutoff, can be the following options: (1) Perc_Pass_Attempts, (2) Perc_Rush_Attempts, (3) Perc_Sacks, or (4) Perc_Total_Plays.

attempt_percent

Percentage of the given attempt_type for QBs on their team that serves as a cutoff for replacement level.

Value

Function that only takes in the model_data_list and returns the replacement level QBs.

Examples

1
2
3
4
5
# First create the function to find the replacement QBs based on "Perc_Total_Plays"
# using a cutoff of 10%:
find_replacement_QBs <- create_percentage_replacement_fn("Perc_Total_Plays", .1)
# Use this function to find the replacement level QBs:
replacement_QBs <- find_replacement_QBs(model_data_list)

ryurko/nflWAR documentation built on May 9, 2019, 7:37 a.m.