create_roster_replacement_fn: Create a function to find replacement level based on the...

Description Usage Arguments Value Examples

Description

Create a function to find replacement level based on the team's depth

Usage

1
create_roster_replacement_fn(replacement_depth, positions, pbp_type)

Arguments

replacement_depth

Number indicating which rank on team's depth chart the replacement level can at most be.

positions

String indicating which position(s) to find the replacement level for, can only be (1) "QB", (2) "RB", (3) "WR", (4) "TE", or (5) "FB".

pbp_type

String indicating which type of performance to use, either use (1) "pass" or (2) "rush".

Value

Function that returns a vector of Player_ID_Name values indicating the replacement level for a given play-by-play dataset based on the replacement_depth to decide the team depth chart cutoff, as well as the position(s) to search for, and the type of the play-by-play data that will be used.

Examples

1
2
3
4
# Create the replacement function for QBs using based on 3rd or higher on the
depth chart using passing performance:
find_replacement_QB <- create_roster_replacement_fn(3, "QB", "pass")
replacement_QBs <- find_replacement_QB(model_data_list)

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