add_players_from_df-optimizer-method.Rd
Add players to optimizer from a data.frame
# S4 method for optimizer
add_players_from_df(object, df)
An optimizer model object
a data.frame of players to add to the model
Optimizer model object with slot players
filled
if (FALSE) {
opt <- create_optimizer(site = 'DRAFTKINGS', sport = 'HOCKEY', contest_type = 'CLASSIC')
dat <- data.frame(first_name = c('Sidney','Alex'),
last_name = c('Crosby','Ovechkin'),
fpts = c(18,20),
team = c('PIT','WAS'),
position = c('C','W'),
salary = c(8000,9000),
game_info = c('this will be','ignored anyway'),
max_exposure = c(0.3, 0.6))
opt <- add_players_from_df(object = opt, df = dat)
}