create_league_replacement_fn: Create a function to find replacement level based on league...

Description Usage Arguments Value Examples

Description

Create a function to find replacement level based on league attempts

Usage

1
2
create_league_replacement_fn(replacement_depth, positions, attempt_type,
  combine_wrte = 0)

Arguments

replacement_depth

Number indicating how many players of that position and performance type each team should have, then every player have that will be considered replacement level.

positions

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

attempt_type

String indicating which type of attempts to use from the position tables to sort the players by for finding the league replacement level.

combine_wrte

Indicator for whether or not to combine the TE and WR position tables, which will be primarily used for rushing attempts by WRs and TEs (default is 0).

Value

Function that returns a vector of Player_ID_Name values indicating the replacement level for the position given the league replacement_depth and attempt_type.

Examples

1
2
3
4
5
# Create the replacement function for RBs by stating every team has 3 RBs on their
# team for rushing, and every RB with less rushing attempts than the top 3*32 is
# considered replacement level:
find_replacement_RB_rush <- create_league_replacement_fn(3, "RB", "Rush_Attempts")
replacement_RBs <- find_replacement_RB_rush(model_data_list)

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