Force Opposing Positions

# S4 method for optimizer
force_opposing_positions(object, pos1, pos2)

Arguments

object

An optimizer object

pos1

Position for team one

pos2

Position for opposing team

Value

Updated optimizer object

Details

Forces positions from opposing teams from being included in lineups. Currently accepts a maximum of two positions.

Examples

if (FALSE) {
opt <- create_optimizer(site = 'DRAFTKINGS', sport = 'FOOTBALL', contest_type = 'CLASSIC')
opt <- add_players_from_csv(object = opt, filepath = '/Path/to/file.csv')

# Force lineup to include a QB and a WR from the opposing team
opt <- force_opposing_positions(object = opt, pos1 = 'QB', pos2 = 'WR')
}