Title: | Simulate Fantasy Football Seasons |
---|---|
Description: | Uses bootstrap resampling to run fantasy football season simulations supported by historical rankings and 'nflfastR' data, calculating optimal lineups, and returning aggregated results. |
Authors: | Tan Ho [aut, cre, cph] |
Maintainer: | Tan Ho <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.2.3.02 |
Built: | 2024-11-02 05:43:52 UTC |
Source: | https://github.com/ffverse/ffsimulator |
Creates automatic plots for wins, ranks, or points for an ff_simulation
object as created by ff_simulate()
.
autoplot.ff_simulation(object, type = c("wins", "rank", "points"), ...) ## S3 method for class 'ff_simulation' plot(x, ..., type = c("wins", "rank", "points"), y)
autoplot.ff_simulation(object, type = c("wins", "rank", "points"), ...) ## S3 method for class 'ff_simulation' plot(x, ..., type = c("wins", "rank", "points"), y)
object |
a |
type |
one of "wins", "rank", "points" |
... |
unused, required by autoplot generic |
x |
A |
y |
Ignored, required for compatibility with the |
Usage of this function/method requires the ggplot2 package and (for wins and points plots) the ggridges package.
a ggplot object
vignette("basic")
for example usage
simulation <- .ffs_cache("foureight_sim.rds") ggplot2::autoplot(simulation) # default is type = "wins" ggplot2::autoplot(simulation, type = "rank") ggplot2::autoplot(simulation, type = "points")
simulation <- .ffs_cache("foureight_sim.rds") ggplot2::autoplot(simulation) # default is type = "wins" ggplot2::autoplot(simulation, type = "rank") ggplot2::autoplot(simulation, type = "points")
Creates automatic plots for wins, ranks, or points for an ff_simulation
object as created by ff_simulate()
.
autoplot.ff_simulation_week(object, type = c("luck", "points"), ...) ## S3 method for class 'ff_simulation_week' plot(x, ..., type = c("luck", "points"), y)
autoplot.ff_simulation_week(object, type = c("luck", "points"), ...) ## S3 method for class 'ff_simulation_week' plot(x, ..., type = c("luck", "points"), y)
object |
a |
type |
one of "luck" or "points" |
... |
unused, required by autoplot generic |
x |
A |
y |
Ignored, required for compatibility with the |
Usage of this function/method requires the ggplot2 package and (for wins and points plots) the ggridges package.
a ggplot object
vignette("basic")
for example usage
simulation <- .ffs_cache("foureight_sim_week.rds") ggplot2::autoplot(simulation) # default is type = "luck" ggplot2::autoplot(simulation, type = "points")
simulation <- .ffs_cache("foureight_sim_week.rds") ggplot2::autoplot(simulation) # default is type = "luck" ggplot2::autoplot(simulation, type = "points")
See ffscrapr::espn_connect()
for details.
a connection object to be used with ff_*
functions
Other ffscrapr-imports:
ff_connect()
,
ff_scoringhistory()
,
ff_starter_positions()
,
fleaflicker_connect()
,
mfl_connect()
,
sleeper_connect()
See ffscrapr::ff_connect()
for details.
a connection object to be used with ff_*
functions
Other ffscrapr-imports:
espn_connect()
,
ff_scoringhistory()
,
ff_starter_positions()
,
fleaflicker_connect()
,
mfl_connect()
,
sleeper_connect()
See ffscrapr::ff_scoringhistory
for details.
A tidy dataframe of weekly fantasy scoring data, one row per player per week
Other ffscrapr-imports:
espn_connect()
,
ff_connect()
,
ff_starter_positions()
,
fleaflicker_connect()
,
mfl_connect()
,
sleeper_connect()
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:2022, actual_schedule = FALSE, replacement_level = TRUE, pos_filter = c("QB", "RB", "WR", "TE", "K"), verbose = NULL, return = c("default", "all") )
ff_simulate( conn, n_seasons = 100, n_weeks = 14, best_ball = FALSE, seed = NULL, gp_model = c("simple", "none"), base_seasons = 2012:2022, actual_schedule = FALSE, replacement_level = TRUE, pos_filter = c("QB", "RB", "WR", "TE", "K"), verbose = NULL, return = c("default", "all") )
conn |
an connection to a league made with |
n_seasons |
number of seasons to simulate, default = 100 |
n_weeks |
number of weeks per season, default = 14 |
best_ball |
a logical: are weekly wins based on optimal lineups? |
seed |
an integer to control reproducibility |
gp_model |
select between "simple", "none" to apply a model for whether a player played in a given game, defaults to "simple" |
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 FALSE |
replacement_level |
a logical: use best available on waiver as replacement level? defaults to 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) |
return |
one of c("default", "all") - what objects to return in the output list |
an ff_simulation
object which can be passed to plot()
and contains the output data from the simulation.
vignette("basic")
for example usage
vignette("custom")
for examples on using the subfunctions for your own processes.
try({ # try block to prevent CRAN-related issues conn <- mfl_connect(2021, 22627) ff_simulate(conn, n_seasons = 25) })
try({ # try block to prevent CRAN-related issues conn <- mfl_connect(2021, 22627) ff_simulate(conn, n_seasons = 25) })
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:2022, actual_schedule = TRUE, replacement_level = FALSE, pos_filter = c("QB", "RB", "WR", "TE", "K"), verbose = NULL, return = c("default", "all") )
ff_simulate_week( conn, n = 1000, best_ball = FALSE, seed = NULL, base_seasons = 2012:2022, actual_schedule = TRUE, replacement_level = FALSE, pos_filter = c("QB", "RB", "WR", "TE", "K"), verbose = NULL, return = c("default", "all") )
conn |
an connection to a league made with |
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 |
an ff_simulation
object which can be passed to plot()
and contains the output data from the simulation.
vignette("basic")
for example usage
vignette("custom")
for examples on using the subfunctions for your own processes.
try({ # try block to prevent CRAN-related issues conn <- mfl_connect(2021, 22627) ff_simulate_week(conn, n = 1000, actual_schedule = TRUE) })
try({ # try block to prevent CRAN-related issues conn <- mfl_connect(2021, 22627) ff_simulate_week(conn, n = 1000, actual_schedule = TRUE) })
See ffscrapr::ff_starter_positions
for details.
A tidy dataframe of positional lineup rules, one row per position with minimum and maximum starters as well as total starter calculations.
Other ffscrapr-imports:
espn_connect()
,
ff_connect()
,
ff_scoringhistory()
,
fleaflicker_connect()
,
mfl_connect()
,
sleeper_connect()
(EXPERIMENTAL) This function adds a basic wins-added calculation for each player on every team, presenting the change in wins if that player was removed from the team as the net wins-over-replacement for that player. This can be a bit of a time/compute-expensive calculation.
ff_wins_added(conn, ...)
ff_wins_added(conn, ...)
conn |
an connection to a league made with |
... |
Arguments passed on to
|
Runs base simulation once (with the usual parameters available for ff_simulate), then for every player on every team (except replacement level players):
remove them from that specific roster
reoptimize the lineups just for that roster without the player to calculate what the score ends up being without the player
summarise the new simulation
return the delta in wins and points
Summarise wins added as the difference between the sim with the player and the sim without them
a dataframe summarising the net effect of each player on their team's wins
try({ # try block to prevent CRAN-related issues # n_seasons set so that the example runs more quickly ff_wins_added(mfl_connect(2021,54040), n_seasons = 5) })
try({ # try block to prevent CRAN-related issues # n_seasons set so that the example runs more quickly ff_wins_added(mfl_connect(2021,54040), n_seasons = 5) })
Add replacement level players to each roster
ffs_add_replacement_level( rosters, latest_rankings, franchises, lineup_constraints, pos_filter = c("QB", "RB", "WR", "TE") )
ffs_add_replacement_level( rosters, latest_rankings, franchises, lineup_constraints, pos_filter = c("QB", "RB", "WR", "TE") )
rosters |
a dataframe of rosters as created by |
latest_rankings |
a dataframe of latest rankings as created by |
franchises |
a dataframe of franchises as created by |
lineup_constraints |
a dataframe of lineup constraints as created by |
pos_filter |
a character vector of positions to filter to, defaults to c("QB","RB","WR","TE","K") |
a dataframe of rosters with replacements
The backbone of the ffsimulator resampling process is coming up with a population of weekly outcomes for every preseason positional rank. This function creates that dataframe by connecting historical FantasyPros.com rankings to nflfastR-based scoring data, as created by ffscrapr::ff_scoringhistory()
.
ffs_adp_outcomes( scoring_history, gp_model = "simple", pos_filter = c("QB", "RB", "WR", "TE") )
ffs_adp_outcomes( scoring_history, gp_model = "simple", pos_filter = c("QB", "RB", "WR", "TE") )
scoring_history |
a scoring history table as created by |
gp_model |
either "simple" or "none" - simple uses the average games played per season for each position/adp combination, none assumes every game is played. |
pos_filter |
a character vector: filter the positions returned to these specific positions, default: c("QB","RB","WR","TE) |
a dataframe with position, rank, probability of games played, and a corresponding nested list per row of all week score outcomes.
fp_rankings_history
for the included historical rankings
fp_injury_table
for the historical injury table
vignette("custom")
for usage details.
# cached data scoring_history <- .ffs_cache("mfl_scoring_history.rds") ffs_adp_outcomes(scoring_history, gp_model = "simple") ffs_adp_outcomes(scoring_history, gp_model = "none")
# cached data scoring_history <- .ffs_cache("mfl_scoring_history.rds") ffs_adp_outcomes(scoring_history, gp_model = "simple") ffs_adp_outcomes(scoring_history, gp_model = "none")
The backbone of the ffsimulator resampling process is coming up with a population of weekly outcomes for every inseason weekly rank. This function creates that dataframe by connecting historical FantasyPros.com rankings to nflfastR-based scoring data, as created by ffscrapr::ff_scoringhistory()
.
ffs_adp_outcomes_week(scoring_history, pos_filter = c("QB", "RB", "WR", "TE"))
ffs_adp_outcomes_week(scoring_history, pos_filter = c("QB", "RB", "WR", "TE"))
scoring_history |
a scoring history table as created by |
pos_filter |
a character vector: filter the positions returned to these specific positions, default: c("QB","RB","WR","TE) |
a dataframe with position, rank, probability of games played, and a corresponding nested list per row of all week score outcomes.
fp_rankings_history_week
for the included historical rankings
# cached data scoring_history <- .ffs_cache("mfl_scoring_history.rds") ffs_adp_outcomes_week(scoring_history, pos_filter = c("QB","RB","WR","TE"))
# cached data scoring_history <- .ffs_cache("mfl_scoring_history.rds") ffs_adp_outcomes_week(scoring_history, pos_filter = c("QB","RB","WR","TE"))
This function generates random head to head schedules for a given number of seasons, teams, and weeks.
ffs_build_schedules( n_teams = NULL, n_seasons = 100, n_weeks = 14, franchises = NULL, seed = NULL )
ffs_build_schedules( n_teams = NULL, n_seasons = 100, n_weeks = 14, franchises = NULL, seed = NULL )
n_teams |
number of teams in simulation |
n_seasons |
number of seasons to simulate, default = 100 |
n_weeks |
number of weeks per season, default = 14 |
franchises |
optional: a dataframe of franchises as created by |
seed |
an integer to control reproducibility |
It starts with the circle method for round robin scheduling, grows or shrinks the schedule to match the required number of weeks, and then shuffles both the order that teams are assigned in and the order that weeks are generated. This doesn't "guarantee" unique schedules, but there are n_teams! x n_weeks! permutations of the schedule so it's very very likely that the schedules are unique (3x10^18 possible schedules for a 12 team league playing 13 weeks).
a dataframe of schedules
vignette("custom")
for example usage
ffs_build_schedules(n_teams = 12, n_seasons = 1, n_weeks = 14)
ffs_build_schedules(n_teams = 12, n_seasons = 1, n_weeks = 14)
Creates a simulation template file with all of the components of ff_simulate, ready for tinkering!
ffs_copy_template( filename = "ff_simulation.R", template = c("season", "week"), overwrite = NULL )
ffs_copy_template( filename = "ff_simulation.R", template = c("season", "week"), overwrite = NULL )
filename |
New file name, defaults to putting "ff_simulation.R" into your current directory |
template |
choice of template: one of "season" or "week" |
overwrite |
a logical (or NULL) - overwrite if existing file found? |
a success message signalling success/failure.
tmp <- tempfile() ffs_copy_template(tmp)
tmp <- tempfile() ffs_copy_template(tmp)
This function lightly wraps ffscrapr::ff_franchises()
and adds league_id, which is a required column for ffsimulator.
ffs_franchises(conn)
ffs_franchises(conn)
conn |
a connection object as created by |
a dataframe of franchises that includes the league_id column
vignette("Custom Simulations") for more detailed example usage
# cached examples conn <- .ffs_cache("mfl_conn.rds") try({ # prevents CRAN connectivity issues, not actually required in normal usage ffs_franchises(conn) })
# cached examples conn <- .ffs_cache("mfl_conn.rds") try({ # prevents CRAN connectivity issues, not actually required in normal usage ffs_franchises(conn) })
Runs the bootstrapped resampling of player week outcomes on the latest rankings and rosters for a given number of seasons and weeks per season.
ffs_generate_projections( adp_outcomes, latest_rankings, n_seasons = 100, weeks = 1:14, rosters = NULL )
ffs_generate_projections( adp_outcomes, latest_rankings, n_seasons = 100, weeks = 1:14, rosters = NULL )
adp_outcomes |
a dataframe of adp-based weekly outcomes, as created by |
latest_rankings |
a dataframe of rankings, as created by |
n_seasons |
number of seasons, default is 100 |
weeks |
a numeric vector of weeks to simulate, defaults to 1:14 |
rosters |
a dataframe of rosters, as created by |
a dataframe of weekly scores for each player in the simulation, approximately of length n_seasons x n_weeks x latest_rankings
vignette("custom") for example usage
# cached examples adp_outcomes <- .ffs_cache("adp_outcomes.rds") latest_rankings <- .ffs_cache("latest_rankings.rds") ffs_generate_projections(adp_outcomes, latest_rankings)
# cached examples adp_outcomes <- .ffs_cache("adp_outcomes.rds") latest_rankings <- .ffs_cache("latest_rankings.rds") ffs_generate_projections(adp_outcomes, latest_rankings)
Runs the bootstrapped resampling of player week outcomes on the latest rankings and rosters for a given number of seasons and weeks per season.
ffs_generate_projections_week( adp_outcomes, latest_rankings, n = 1000, rosters = NULL )
ffs_generate_projections_week( adp_outcomes, latest_rankings, n = 1000, rosters = NULL )
adp_outcomes |
a dataframe of adp-based weekly outcomes, as created by |
latest_rankings |
a dataframe of rankings, as created by |
n |
number of weeks to simulate |
rosters |
a dataframe of rosters, as created by |
a dataframe of weekly scores for each player in the simulation, approximately of length n_seasons x n_weeks x latest_rankings
vignette("custom") for example usage
# cached examples adp_outcomes_week <- .ffs_cache("adp_outcomes_week.rds") latest_rankings_week <- .ffs_cache("latest_rankings_week.rds") ffs_generate_projections_week(adp_outcomes_week, latest_rankings_week)
# cached examples adp_outcomes_week <- .ffs_cache("adp_outcomes_week.rds") latest_rankings_week <- .ffs_cache("latest_rankings_week.rds") ffs_generate_projections_week(adp_outcomes_week, latest_rankings_week)
Fetches a copy of the latest FantasyPros redraft positional rankings data from DynastyProcess.com's data repository.
ffs_latest_rankings(type = c("draft", "week"))
ffs_latest_rankings(type = c("draft", "week"))
type |
one of "draft" or "week" - controls whether to pull preseason or inseason rankings. |
If you have any issues with the output of this data, please open an issue in the DynastyProcess data repository.
a dataframe with a copy of the latest FP rankings from DynastyProcess's data repository
https://github.com/dynastyprocess/data
vignette("custom")
for example usage
try({ # try block to prevent CRAN-related issues ffs_latest_rankings() })
try({ # try block to prevent CRAN-related issues ffs_latest_rankings() })
Calculates optimal lineups for all franchises in the dataframe based on a table of lineup constraints.
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") )
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") )
roster_scores |
a dataframe as generated by |
lineup_constraints |
a dataframe as generated by |
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 |
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%.
a dataframe of what each team scored for each week
vignette("custom")
for example usage
# cached examples roster_scores <- .ffs_cache("roster_scores.rds") lineup_constraints <- .ffs_cache("mfl_lineup_constraints.rds") ffs_optimise_lineups(roster_scores, lineup_constraints)
# cached examples roster_scores <- .ffs_cache("roster_scores.rds") lineup_constraints <- .ffs_cache("mfl_lineup_constraints.rds") ffs_optimise_lineups(roster_scores, lineup_constraints)
This function repeats an actual ffs_schedule()
by the appropriate number of seasons.
ffs_repeat_schedules(actual_schedule, n_seasons)
ffs_repeat_schedules(actual_schedule, n_seasons)
actual_schedule |
a schedule retrieved by |
n_seasons |
number of seasons to simulate, default = 100 |
a dataframe of schedules for the simulation
vignette("Custom Simulations")
for example usage
try({ # try block to prevent CRAN-related issues conn <- .ffs_cache("mfl_conn.rds") # cached connection actual_schedule <- ffs_schedule(conn) ffs_repeat_schedules(actual_schedule = actual_schedule, n_seasons = 10) })
try({ # try block to prevent CRAN-related issues conn <- .ffs_cache("mfl_conn.rds") # cached connection actual_schedule <- ffs_schedule(conn) ffs_repeat_schedules(actual_schedule = actual_schedule, n_seasons = 10) })
This function lightly wraps ffscrapr::ff_rosters()
and adds fantasypros_id, which is a required column for ffsimulator.
ffs_rosters(conn) ## S3 method for class 'mfl_conn' ffs_rosters(conn) ## S3 method for class 'sleeper_conn' ffs_rosters(conn) ## S3 method for class 'flea_conn' ffs_rosters(conn) ## S3 method for class 'espn_conn' ffs_rosters(conn)
ffs_rosters(conn) ## S3 method for class 'mfl_conn' ffs_rosters(conn) ## S3 method for class 'sleeper_conn' ffs_rosters(conn) ## S3 method for class 'flea_conn' ffs_rosters(conn) ## S3 method for class 'espn_conn' ffs_rosters(conn)
conn |
a connection object as created by |
a dataframe of rosters that includes a fantasypros_id column
vignette("custom") for more detailed example usage
# cached examples conn <- .ffs_cache("mfl_conn.rds") try({ # prevents CRAN connectivity issues, not actually required in normal usage ffs_rosters(conn) })
# cached examples conn <- .ffs_cache("mfl_conn.rds") try({ # prevents CRAN connectivity issues, not actually required in normal usage ffs_rosters(conn) })
This function lightly wraps ffscrapr::ff_schedule()
and adds league_id, which is a required column for ffsimulator, casts IDs to character, and drops actual games played so as to only simulate unplayed games.
ffs_schedule(conn)
ffs_schedule(conn)
conn |
a connection object as created by |
a dataframe of schedule that includes the league_id column
vignette("Custom Simulations") for more detailed example usage
# cached examples try({ # try block to prevent CRAN-related issues conn <- .ffs_cache("mfl_conn.rds") ffs_schedule(conn) })
# cached examples try({ # try block to prevent CRAN-related issues conn <- .ffs_cache("mfl_conn.rds") ffs_schedule(conn) })
Attaches projected scores to rosters (via an inner-join) and creates a positional ranking column.
ffs_score_rosters(projected_scores, rosters)
ffs_score_rosters(projected_scores, rosters)
projected_scores |
a dataframe of projected scores, as created by |
rosters |
a dataframe of rosters, as created by |
A dataframe of roster-level projected scores
vignette("custom") for example usage
# cached examples projected_scores <- .ffs_cache("projected_scores.rds") rosters <- .ffs_cache("mfl_rosters.rds") ffs_score_rosters(projected_scores, rosters)
# cached examples projected_scores <- .ffs_cache("projected_scores.rds") rosters <- .ffs_cache("mfl_rosters.rds") ffs_score_rosters(projected_scores, rosters)
This function lightly wraps ffscrapr::ff_starter_positions()
and cleans up some abbreviations (PK -> K)
ffs_starter_positions(conn)
ffs_starter_positions(conn)
conn |
a connection object as created by |
A tidy dataframe of positional lineup rules, one row per position with minimum and maximum starters as well as total starter calculations.
# cached examples try({ # try block to prevent CRAN-related issues conn <- .ffs_cache("mfl_conn.rds") ffs_starter_positions(conn) })
# cached examples try({ # try block to prevent CRAN-related issues conn <- .ffs_cache("mfl_conn.rds") ffs_starter_positions(conn) })
These functions are used to summarise the simulation outputs, typically by joining the optimal scores with a matching schedule.
ffs_summarise_week(optimal_scores, schedules) ffs_summarise_season(summary_week) ffs_summarise_simulation(summary_season) ffs_summarise_inseason(summary_week, n) ffs_summarize_week(optimal_scores, schedules) ffs_summarize_season(summary_week) ffs_summarize_simulation(summary_season)
ffs_summarise_week(optimal_scores, schedules) ffs_summarise_season(summary_week) ffs_summarise_simulation(summary_season) ffs_summarise_inseason(summary_week, n) ffs_summarize_week(optimal_scores, schedules) ffs_summarize_season(summary_week) ffs_summarize_simulation(summary_season)
optimal_scores |
a dataframe of optimized lineups as created by |
schedules |
a dataframe of schedules as created by |
summary_week |
a dataframe as created by |
summary_season |
a dataframe as created by |
n |
number of weeks |
ffs_summarise_week: a dataframe summarising team results by simulation week
ffs_summarise_season: a dataframe summarising franchise results across each simulation season
ffs_summarise_simulation: a dataframe summarising franchise results across the simulation
ffs_summarise_inseason: a dataframe summarising franchise results for the inseason simulation
vignette("custom")
for example usage
# cached examples optimal_scores <- .ffs_cache("optimal_scores.rds") schedules <- .ffs_cache("schedules.rds") summary_week <- ffs_summarise_week(optimal_scores, schedules) summary_week summary_season <- ffs_summarise_season(summary_week) summary_season summary_simulation <- ffs_summarise_simulation(summary_season) summary_simulation
# cached examples optimal_scores <- .ffs_cache("optimal_scores.rds") schedules <- .ffs_cache("schedules.rds") summary_week <- ffs_summarise_week(optimal_scores, schedules) summary_week summary_season <- ffs_summarise_season(summary_week) summary_season summary_simulation <- ffs_summarise_simulation(summary_season) summary_simulation
See ffscrapr::fleaflicker_connect()
for details.
a connection object to be used with ff_*
functions
Other ffscrapr-imports:
espn_connect()
,
ff_connect()
,
ff_scoringhistory()
,
ff_starter_positions()
,
mfl_connect()
,
sleeper_connect()
This dataframe contains a column (prob_gp
) for each positional ranking that describes the probability of a player with that preseason ADP playing in a given game. It is modelled from historical rankings data and the number of games played per season for a given positional rank.
fp_injury_table
fp_injury_table
An object of class tbl_df
(inherits from tbl
, data.frame
) with 692 rows and 3 columns.
This dataframe has historical positional draft rankings for 2012-2020 QB/RB/WR/TE/PK and 2015-2020 DL/LB/DB, as gathered by the ffpros package.
fp_rankings_history
fp_rankings_history
An object of class tbl_df
(inherits from tbl
, data.frame
) with 11336 rows and 10 columns.
This dataframe has historical positional in-season rankings for 2012-2020 QB/RB/WR/TE/PK and 2015-2020 DL/LB/DB, as gathered by the ffpros package.
fp_rankings_history_week
fp_rankings_history_week
An object of class tbl_df
(inherits from tbl
, data.frame
) with 94257 rows and 11 columns.
See ffscrapr::mfl_connect()
for details.
a connection object to be used with ff_*
functions
Other ffscrapr-imports:
espn_connect()
,
ff_connect()
,
ff_scoringhistory()
,
ff_starter_positions()
,
fleaflicker_connect()
,
sleeper_connect()
See ffscrapr::sleeper_connect()
for details.
a connection object to be used with ff_*
functions
Other ffscrapr-imports:
espn_connect()
,
ff_connect()
,
ff_scoringhistory()
,
ff_starter_positions()
,
fleaflicker_connect()
,
mfl_connect()