Learn R Programming

nflseedR (version 2.0.0)

compute_conference_seeds: Compute NFL Playoff Seedings using Game Results and Divisional Rankings

Description

Compute NFL Playoff Seedings using Game Results and Divisional Rankings

Usage

compute_conference_seeds(
  teams,
  h2h = NULL,
  tiebreaker_depth = 3,
  .debug = FALSE,
  playoff_seeds = 7
)

Value

A data frame of division standings including playoff seeds and the week in which the season ended for the respective team (exit).

A list of two data frames:

standings

Division standings including playoff seeds.

h2h

A data frame that is used for head-to-head tiebreakers across the tie-breaking functions.

Arguments

teams

The division standings data frame as computed by compute_division_ranks

h2h

A data frame that is used for head-to-head tiebreakers across the tie-breaking functions. It is computed by the function compute_division_ranks.

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:

tiebreaker_depth = 1

Break all ties with a coinflip. Fastest variant.

tiebreaker_depth = 2

Apply head-to-head and division win percentage tiebreakers. Random if still tied.

tiebreaker_depth = 3

Apply all tiebreakers through strength of schedule. Random if still tied.

.debug

Either TRUE or FALSE. Controls whether additional messages are printed to the console showing what the tie-breaking algorithms are currently performing.

playoff_seeds

Number of playoff teams per conference (increased in 2020 from 6 to 7).

See Also

Examples

Run this code
# \donttest{
# 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
s <- nflseedR::load_sharpe_games() |>
  dplyr::filter(season %in% 2019:2020) |>
  dplyr::select(sim = season, game_type, week, away_team, home_team, result) |>
  nflseedR::compute_division_ranks()
  nflseedR::compute_conference_seeds(s, h2h = s$h2h) |>
  purrr::pluck("standings")
})

# Restore old options
options(old)
# }

Run the code above in your browser using DataLab