View source: R/compute_draft_order.R
compute_draft_order | R Documentation |
Compute NFL Draft Order using Game Results and Divisional Rankings
compute_draft_order(
teams,
games,
h2h = NULL,
tiebreaker_depth = 3,
.debug = FALSE
)
teams |
The division standings data frame including playoff seeds as
computed by |
games |
A data frame containing real or simulated game scores. The following variables are required:
|
h2h |
A data frame that is used for head-to-head tiebreakers across the
tie-breaking functions. It is computed by the function
|
tiebreaker_depth |
A single value equal to 1, 2, or 3. The default is 3. The value controls the depth of tiebreakers that shall be applied. The deepest currently implemented tiebreaker is strength of schedule. The following values are valid:
|
.debug |
Either |
A data frame of standings including the final draft pick number and
the variable exit
which indicates the week number of the teams final
game (Super Bowl Winner is one week higher).
The examples on the package website
# Change some options for better output
old <- options(list(digits = 3, tibble.print_min = 64))
library(dplyr, warn.conflicts = FALSE)
try({#to avoid CRAN test problems
games <-
nflseedR::load_sharpe_games() |>
dplyr::filter(season %in% 2018:2019) |>
dplyr::select(sim = season, game_type, week, away_team, home_team, result)
s <- games |> nflseedR::compute_division_ranks()
s <- nflseedR::compute_conference_seeds(s, h2h = s$h2h, playoff_seeds = 6)
nflseedR::compute_draft_order(s, games = games, h2h = s$h2h)
})
# Restore old options
options(old)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.