Learn R Programming

ffsimulator (version 1.2.3)

ff_simulate_week: Simulate Fantasy Week

Description

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

Usage

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

Value

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

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

replacement_level

a logical: use best available on waiver as replacement level? defaults to FALSE for upcoming week simulations

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)

return

one of c("default", "all") - what objects to return in the output list

See Also

vignette("basic") for example usage

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

Examples

Run this code
# \donttest{
try({ # try block to prevent CRAN-related issues
conn <- mfl_connect(2021, 22627)
ff_simulate_week(conn, n = 1000, actual_schedule = TRUE)
})
# }

Run the code above in your browser using DataLab