add_team_stack-optimizer-method: Add a Team Stack

add_team_stack,optimizer-methodR Documentation

Add a Team Stack

Description

Add a Team Stack

Usage

## S4 method for signature 'optimizer'
add_team_stack(
  object,
  positions,
  opt_positions = NULL,
  nstacks = 1,
  within_lines = FALSE
)

Arguments

object

An optimizer model object

positions

Positions to stack within same team

opt_positions

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.

nstacks

Number of stacks to include (Default is 1)

within_lines

Logical. Whether Stacks should be built within lines or depth. If 'sport' is not hockey, this is ignored.

Value

Updated optimizer object

Examples

## Not run: 
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'))

## End(Not run)


anthonyshook/dfsOptimizer documentation built on Jan. 4, 2023, 11:36 a.m.