Code Monkey home page Code Monkey logo

ffsimulator's Introduction

ffsimulator

CRAN status Dev version Lifecycle: experimental R build status Codecov test coverage nflverse discord

The {ffsimulator} package uses bootstrap resampling to run fantasy football season simulations supported by historical rankings and nflfastR data, calculating optimal lineups, and returning aggregated results. This can quickly run your league through hundreds of seasons and builds out the data to help you study:

  • expected season finishes and range of outcomes
  • player contributions to season wins
  • roster constructions
  • effects of (potential) trades
  • and more!

This package is part of the ffverse family of R packages for fantasy football analysis.

Installation

Install the stable version of this package from CRAN:

install.packages("ffsimulator") # CRAN

Install the development version from either r-universe or GitHub:

install.packages("ffsimulator", repos = "https://ffverse.r-universe.dev")
# pak is recommended, see https://github.com/r-lib/pak
pak::pak("ffverse/ffsimulator")
# can also use remotes
remotes::install_github("ffverse/ffsimulator")

The development version has a separate documentation site here.

Usage

A season simulation can be run as follows:

library(ffsimulator)
library(ggplot2)
library(ggridges)

mfl_conn <- mfl_connect(season = 2021, league_id = 22627)

## OTHER PLATFORM CONNECTIONS MAY BE USED, FOR EXAMPLE:
# sleeper_conn <- sleeper_connect(season = 2021,  league_id = "652582284720971776") 
# flea_conn <- fleaflicker_connect(season = 2021, league_id = 312861) 
# espn_conn <- espn_connect(season = 2021, league_id = 899513)

mfl_sim <- ff_simulate(conn = mfl_conn, n_seasons = 100)

plot(mfl_sim)

Please also see the

vignettes for more detailed introductions.

Getting help

The best places to get help on this package are:

Contributing

Many hands make light work! Here are some ways you can contribute to this project:

Terms of Use

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.

ffsimulator's People

Contributors

maatspencer avatar randalmorris avatar tanho63 avatar topfunky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.