The {ffsimulator}
package helps simulate fantasy football seasons. By
leveraging historical weekly finishes, current expert consensus
rankings, and your league’s data, this package can quickly run your
league through hundreds of seasons and may help you study:
- expected season finishes and range of outcomes
- player contributions to season wins
- effects of potential trades
- and more!
This package is part of the ffverse family of R packages for fantasy football analysis.
Install the stable version of this package from the ffverse r-universe repository:
install.packages("ffsimulator", repos = "https://ffverse.r-universe.dev")
Install the development version with either DynastyProcess’s r-universe or remotes + GitHub:
# ffverse's r-universe
install.packages("ffsimulator", repos = "https://dynastyprocess.r-universe.dev")
# or via GitHub c/o remotes/devtools: # install.packages('remotes')
remotes::install_github("dynastyprocess/ffsimulator")
The dev version has a separate documentation site here.
- Create logic in ADP outcomes to bin together nearby ranks (nearest one above/below) ✅ (binning +1 and -1 together)
- Scrape more historical ranks to include in package so that we can use 2010-2020 ✅ (2012-2020 is close enough!)
- Patch data inconsistency for IDs (2012:2015)
- Create join functions for each of the remaining ff_connect classes :white_check_mark:
- Create summary function (season-level H2H wins/winpct, AP wins/winpct, total PF + PP) ✅
- Create simulation summary table ✅
- Write function documentation ✅
- Write tests ✅
- Add test cache infrastructure
- Write basic usage vignette
- Write custom usage vignette
- Add autoplot
- Clean up README
- CRAN prep
This package shares many conventions with the ffverse, including all
main functions being prefixed with ff_
for ease of autocomplete.
library(ffsimulate)
conn <- mfl_connect(2021,22627)
sims <- ff_simulate(conn, n_seasons = 100, weeks_per_season = 14, best_ball = FALSE)
sims$summary
Please also see the basic usage and manual simulation vignettes for a detailed introduction.
The best places to get help on this package are:
- the nflverse discord (for both this package as well as anything R/NFL related)
- opening an issue
Many hands make light work! Here are some ways you can contribute to this project:
-
You can open an issue if you’d like to request specific data or report a bug/error.
-
You can sponsor this project with donations!
-
If you’d like to contribute code, please check out the contribution guidelines.
The R code for this package is released as open source under the MIT License.
Fantasy football and NFL data accessed by this package belong to their respective owners, and are governed by their terms of use.