| set_players_per_team,optimizer-method | R Documentation |
Method used to set team specific exposures. Note, you can set one EXACT and one MAX set of team restrictions per model.
## S4 method for signature 'optimizer' set_players_per_team(object, players_per_team, exact = FALSE)
object |
An optimizer object |
players_per_team |
A named list, where the names are teams, and the values are the number of players to include for each team |
exact |
Logical. Whether the number in |
Updated optimizer object
## Not run:
# 'opt' is an optimizer model object
# Force the lineup to include a maximum of two players
# from BUF, and prevent any CLE players from being
# included in the lineup
opt <- set_players_per_team(object = opt,
players_per_team = list(BUF = 2, CLE = 0))
# Set lineup to include exactly three SF players
opt <- set_players_per_team(object = opt, players_per_team = list(SF = 3), exact = TRUE)
# Include up to 3 players from NYG, and exactly two players from TEN
opt <- set_players_per_team(object = opt,
players_per_team = list(NYG = 3, TEN = 2),
exact = c(FALSE, TRUE))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.