Method for setting FLEX/UTIL positions. Can be used to limit FLEX/UTIL to a user-specified set of possible positions (see examples).

# S4 method for optimizer
set_flex_positions(object, positions)

Arguments

object

An optimizer object

positions

Value to set the roster size (subject to validity checks).

Value

Updated Optimizer object

Examples

if (FALSE) {
opt <- create_optimizer(site = 'DRAFTKINGs', sport = 'HOCKEY')
opt <- add_players_from_csv(object = opt, filepath = '/Path/to/file.csv')

# Default FLEX is c('C','W','D') -- here we'll remove D
opt <- set_flex_positions(object = opt, positions = c('C','W'))
}