ffs_build_schedules | R Documentation |
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 )
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.