Learn R Programming

ffsimulator (version 1.2.3)

ffs_optimise_lineups: Optimise Lineups

Description

Calculates optimal lineups for all franchises in the dataframe based on a table of lineup constraints.

Usage

ffs_optimise_lineups(
  roster_scores,
  lineup_constraints,
  lineup_efficiency_mean = 0.775,
  lineup_efficiency_sd = 0.05,
  best_ball = FALSE,
  pos_filter = c("QB", "RB", "WR", "TE")
)

ffs_optimize_lineups( roster_scores, lineup_constraints, lineup_efficiency_mean = 0.775, lineup_efficiency_sd = 0.05, best_ball = FALSE, pos_filter = c("QB", "RB", "WR", "TE") )

Value

a dataframe of what each team scored for each week

Arguments

roster_scores

a dataframe as generated by ffs_score_rosters() - should contain columns like: projected_score, pos, and player_id

lineup_constraints

a dataframe as generated by ffscrapr::ff_starter_positions() - should contain columns pos, min, max, and offense_starters

lineup_efficiency_mean

the average lineup efficiency to use, defaults to 0.775

lineup_efficiency_sd

the standard deviation of lineup efficiency, defaults to 0.05

best_ball

a logical: FALSE will apply a lineup efficiency factor and TRUE uses optimal scores as actual scores, default = FALSE

pos_filter

a character vector specifying which positions are eligible - defaults to c("QB","RB","WR","TE)

Details

Lineup efficiency is the percentage of optimal/best-ball score that is used as the actual score - by default, the lineup efficiency for a team in non-best-ball settings is normally distributed around a mean of 77.5% and a standard deviation of 5%.

See Also

vignette("custom") for example usage

Examples

Run this code
# \donttest{
# cached examples
roster_scores <- .ffs_cache("roster_scores.rds")
lineup_constraints <- .ffs_cache("mfl_lineup_constraints.rds")

ffs_optimise_lineups(roster_scores, lineup_constraints)
# }

Run the code above in your browser using DataLab