powered by
The main function of the package - uses bootstrap resampling to run fantasy football season simulations supported by historical rankings and nflfastR data, calculating optimal lineups, and returns aggregated results.
ff_simulate( conn, n_seasons = 100, n_weeks = 14, best_ball = FALSE, seed = NULL, gp_model = c("simple", "none"), base_seasons = 2012:2020, actual_schedule = FALSE, replacement_level = TRUE, pos_filter = c("QB", "RB", "WR", "TE", "K"), verbose = NULL, return = c("default", "all") )
an ff_simulation object which can be passed to plot() and contains the output data from the simulation.
ff_simulation
plot()
an connection to a league made with ff_connect() and friends (required)
ff_connect()
number of seasons to simulate, default = 100
number of weeks per season, default = 14
a logical: are weekly wins based on optimal lineups?
an integer to control reproducibility
select between "simple", "none" to apply a model for whether a player played in a given game, defaults to "simple"
a numeric vector that selects seasons as base data, earliest available is 2012
a logical: use actual ff_schedule? default is FALSE
a logical: use best available on waiver as replacement level? defaults to TRUE
a character vector of positions to filter/run, default is c("QB","RB","WR","TE","K")
a logical: print status messages? default is TRUE, configure with options(ffsimulator.verbose)
one of c("default", "all") - what objects to return in the output list
vignette("basic") for example usage
vignette("basic")
vignette("custom") for examples on using the subfunctions for your own processes.
vignette("custom")
# \donttest{ try({ # try block to prevent CRAN-related issues conn <- mfl_connect(2021, 22627) ff_simulate(conn, n_seasons = 25) }) # }
Run the code above in your browser using DataLab