Add players to optimizer from a data.frame

# S4 method for optimizer
add_players_from_df(object, df)

Arguments

object

An optimizer model object

df

a data.frame of players to add to the model

Value

Optimizer model object with slot players filled

Examples

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)
}