add_team_stack-optimizer-method.Rd
Add a Team Stack
# S4 method for optimizer
add_team_stack(
object,
positions,
opt_positions = NULL,
nstacks = 1,
within_lines = FALSE
)
An optimizer model object
Positions to stack within same team
A vector of optional positions. Used to build OR-based stacks, such as QB + WR + (TE or RB). Always selects just one of the optional positions.
Number of stacks to include (Default is 1)
Logical. Whether Stacks should be built within lines or depth. If 'sport' is not hockey, this is ignored.
Updated optimizer object
if (FALSE) {
opt <- create_optimizer(site = 'DRAFTKINGS', sport = 'HOCKEY', contest_type = 'CLASSIC')
opt <- add_players_from_csv(object = opt, filepath = '/Path/to/file.csv')
# Add team stack, requiring a Center and Two Wingers from the same team
opt <- add_team_stack(object = opt, positions = c('C','W','W'))
# Add team stack, with a Center and a Winger, and one of either another center or winger
opt <- add_team_stack(object = opt, positions = c('C','W'), opt_positions = c('C','W'))
}