This function simulates a single upcoming week using the same methodology as in the season-long simulation, ff_simulate().

ff_simulate_week(
  conn,
  n = 1000,
  best_ball = FALSE,
  seed = NULL,
  base_seasons = 2012:2020,
  actual_schedule = TRUE,
  pos_filter = c("QB", "RB", "WR", "TE", "K"),
  verbose = getOption("ffsimulator.verbose", default = TRUE)
)

Arguments

conn

an connection to a league made with ff_connect() and friends (required)

n

number of times to simulate the upcoming week, default is 1000

best_ball

a logical: are weekly wins based on optimal lineups?

seed

an integer to control reproducibility

base_seasons

a numeric vector that selects seasons as base data, earliest available is 2012

actual_schedule

a logical: use actual ff_schedule? default is TRUE

pos_filter

a character vector of positions to filter/run, default is c("QB","RB","WR","TE","K")

verbose

a logical: print status messages? default is TRUE, configure with options(ffsimulator.verbose)

Value

an ff_simulation object which can be passed to plot() and contains the output data from the simulation.

See also

vignette("basic") for example usage

vignette("custom") for examples on using the subfunctions for your own processes.

Examples

# \donttest{ conn <- mfl_connect(2021, 22627) ff_simulate_week(conn, n = 1000, actual_schedule = TRUE)
#> ── Starting simulation 2021-10-28 17:12:23 ─────────────────────────────────────
#> Importing data
#> Importing data...done! 2021-10-28 17:12:32
#>
#> Generating Projections
#> Generating Projections...done! 2021-10-28 17:12:37
#>
#> Calculating Roster Scores
#> Calculating Roster Scores...done! 2021-10-28 17:12:38
#>
#> Optimizing Lineups
#> Optimizing Lineups...done! 2021-10-28 17:12:49
#>
#> Building Schedules
#> Building Schedules...done! 2021-10-28 17:12:49
#>
#> Summarising Simulation Data
#> Summarising Simulation Data...done! 2021-10-28 17:12:49
#>
#> ── Simulation complete! 2021-10-28 17:12:49 ────────────────────────────────────
#> <ff_simulation_week: 1000 simulated weeks of Four-Eight Dynasty League> #> List of 6 #> $ summary_simulation:Classes ‘data.table’ and 'data.frame': 12 obs. of 11 variables: #> $ summary_week :Classes ‘data.table’ and 'data.frame': 12000 obs. of 16 variables: #> $ roster_scores :Classes ‘data.table’ and 'data.frame': 282000 obs. of 23 variables: #> $ projected_scores :Classes ‘data.table’ and 'data.frame': 282000 obs. of 13 variables: #> $ league_info : tibble [1 × 17] (S3: tbl_df/tbl/data.frame) #> $ simulation_params :List of 7
# }