Compute NFL Draft Order using Game Results and Divisional Rankings

compute_draft_order(
  teams,
  games,
  h2h = NULL,
  tiebreaker_depth = 3,
  .debug = FALSE
)

Arguments

teams

The division standings data frame including playoff seeds as computed by compute_conference_seeds

games

A data frame containing real or simulated game scores. The following variables are required:

sim

A simulation ID. Normally 1 - n simulated seasons.

game_type

One of 'REG', 'WC', 'DIV', 'CON', 'SB' indicating if a game was a regular season game or one of the playoff rounds.

week

The week of the corresponding NFL season.

away_team

Team abbreviation of the away team (please see divisions for valid team abbreviations).

home_team

Team abbreviation of the home team (please see divisions for valid team abbreviations).

result

Equals home score - away score.

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.

Value

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).

See also

Examples

# \donttest{
# Change some options for better output
old <- options(list(digits = 3, tibble.print_min = 64))
library(dplyr, warn.conflicts = FALSE)

games <-
  nflseedR::load_sharpe_games() %>%
  dplyr::filter(season %in% 2018:2019) %>%
  dplyr::select(sim = season, game_type, week, away_team, home_team, result)

games %>%
  nflseedR::compute_division_ranks() %>%
  nflseedR::compute_conference_seeds(h2h = .$h2h, playoff_seeds = 6) %>%
  nflseedR::compute_draft_order(games = games, h2h = .$h2h)
#>  2021-10-31 13:37:11: Calculating team data
#>  2021-10-31 13:37:11: Calculating head to head
#>  2021-10-31 13:37:11: Calculating division rank #1
#>  2021-10-31 13:37:11: Calculating division rank #2
#>  2021-10-31 13:37:11: Calculating division rank #3
#>  2021-10-31 13:37:11: Calculating division rank #4
#>  2021-10-31 13:37:11: Calculating seed #1
#>  2021-10-31 13:37:11: Calculating seed #2
#>  2021-10-31 13:37:12: Calculating seed #3
#>  2021-10-31 13:37:12: Calculating seed #4
#>  2021-10-31 13:37:12: Calculating seed #5
#>  2021-10-31 13:37:12: Calculating seed #6
#>  2021-10-31 13:37:12: Calculating draft order #32
#>  2021-10-31 13:37:12: Calculating draft order #31
#>  2021-10-31 13:37:12: Calculating draft order #30
#>  2021-10-31 13:37:12: Calculating draft order #29
#>  2021-10-31 13:37:12: Calculating draft order #28
#>  2021-10-31 13:37:12: Calculating draft order #27
#>  2021-10-31 13:37:12: Calculating draft order #26
#>  2021-10-31 13:37:12: Calculating draft order #25
#>  2021-10-31 13:37:12: Calculating draft order #24
#>  2021-10-31 13:37:12: Calculating draft order #23
#>  2021-10-31 13:37:12: Calculating draft order #22
#>  2021-10-31 13:37:12: Calculating draft order #21
#>  2021-10-31 13:37:12: Calculating draft order #20
#>  2021-10-31 13:37:12: Calculating draft order #19
#>  2021-10-31 13:37:12: Calculating draft order #18
#>  2021-10-31 13:37:12: Calculating draft order #17
#>  2021-10-31 13:37:12: Calculating draft order #16
#>  2021-10-31 13:37:13: Calculating draft order #15
#>  2021-10-31 13:37:13: Calculating draft order #14
#>  2021-10-31 13:37:13: Calculating draft order #13
#>  2021-10-31 13:37:13: Calculating draft order #12
#>  2021-10-31 13:37:13: Calculating draft order #11
#>  2021-10-31 13:37:13: Calculating draft order #10
#>  2021-10-31 13:37:13: Calculating draft order #9
#>  2021-10-31 13:37:13: Calculating draft order #8
#>  2021-10-31 13:37:13: Calculating draft order #7
#>  2021-10-31 13:37:13: Calculating draft order #6
#>  2021-10-31 13:37:13: Calculating draft order #5
#>  2021-10-31 13:37:13: Calculating draft order #4
#>  2021-10-31 13:37:13: Calculating draft order #3
#>  2021-10-31 13:37:13: Calculating draft order #2
#>  2021-10-31 13:37:13: Calculating draft order #1
#> # A tibble: 64 × 16
#>      sim team  conf  division  games  wins true_wins win_pct div_pct conf_pct
#>    <int> <chr> <chr> <chr>     <int> <dbl>     <int>   <dbl>   <dbl>    <dbl>
#>  1  2018 BUF   AFC   AFC East     16   6           6   0.375   0.333    0.333
#>  2  2018 MIA   AFC   AFC East     16   7           7   0.438   0.667    0.5  
#>  3  2018 NE    AFC   AFC East     16  11          11   0.688   0.833    0.667
#>  4  2018 NYJ   AFC   AFC East     16   4           4   0.25    0.167    0.25 
#>  5  2018 BAL   AFC   AFC North    16  10          10   0.625   0.5      0.667
#>  6  2018 CIN   AFC   AFC North    16   6           6   0.375   0.167    0.333
#>  7  2018 CLE   AFC   AFC North    16   7.5         7   0.469   0.583    0.458
#>  8  2018 PIT   AFC   AFC North    16   9.5         9   0.594   0.75     0.542
#>  9  2018 HOU   AFC   AFC South    16  11          11   0.688   0.667    0.75 
#> 10  2018 IND   AFC   AFC South    16  10          10   0.625   0.667    0.583
#> 11  2018 JAX   AFC   AFC South    16   5           5   0.312   0.167    0.333
#> 12  2018 TEN   AFC   AFC South    16   9           9   0.562   0.5      0.417
#> 13  2018 DEN   AFC   AFC West     16   6           6   0.375   0.333    0.333
#> 14  2018 KC    AFC   AFC West     16  12          12   0.75    0.833    0.833
#> 15  2018 LAC   AFC   AFC West     16  12          12   0.75    0.667    0.75 
#> 16  2018 OAK   AFC   AFC West     16   4           4   0.25    0.167    0.25 
#> 17  2018 DAL   NFC   NFC East     16  10          10   0.625   0.833    0.75 
#> 18  2018 NYG   NFC   NFC East     16   5           5   0.312   0.167    0.333
#> 19  2018 PHI   NFC   NFC East     16   9           9   0.562   0.667    0.5  
#> 20  2018 WAS   NFC   NFC East     16   7           7   0.438   0.333    0.5  
#> 21  2018 CHI   NFC   NFC North    16  12          12   0.75    0.833    0.833
#> 22  2018 DET   NFC   NFC North    16   6           6   0.375   0.333    0.333
#> 23  2018 GB    NFC   NFC North    16   6.5         6   0.406   0.25     0.292
#> 24  2018 MIN   NFC   NFC North    16   8.5         8   0.531   0.583    0.542
#> 25  2018 ATL   NFC   NFC South    16   7           7   0.438   0.667    0.583
#> 26  2018 CAR   NFC   NFC South    16   7           7   0.438   0.333    0.417
#> 27  2018 NO    NFC   NFC South    16  13          13   0.812   0.667    0.75 
#> 28  2018 TB    NFC   NFC South    16   5           5   0.312   0.333    0.333
#> 29  2018 ARI   NFC   NFC West     16   3           3   0.188   0.333    0.25 
#> 30  2018 LA    NFC   NFC West     16  13          13   0.812   1        0.75 
#> 31  2018 SEA   NFC   NFC West     16  10          10   0.625   0.5      0.667
#> 32  2018 SF    NFC   NFC West     16   4           4   0.25    0.167    0.167
#> 33  2019 BUF   AFC   AFC East     16  10          10   0.625   0.5      0.583
#> 34  2019 MIA   AFC   AFC East     16   5           5   0.312   0.333    0.333
#> 35  2019 NE    AFC   AFC East     16  12          12   0.75    0.833    0.667
#> 36  2019 NYJ   AFC   AFC East     16   7           7   0.438   0.333    0.333
#> 37  2019 BAL   AFC   AFC North    16  14          14   0.875   0.833    0.833
#> 38  2019 CIN   AFC   AFC North    16   2           2   0.125   0.167    0.167
#> 39  2019 CLE   AFC   AFC North    16   6           6   0.375   0.5      0.5  
#> 40  2019 PIT   AFC   AFC North    16   8           8   0.5     0.5      0.5  
#> 41  2019 HOU   AFC   AFC South    16  10          10   0.625   0.667    0.667
#> 42  2019 IND   AFC   AFC South    16   7           7   0.438   0.5      0.417
#> 43  2019 JAX   AFC   AFC South    16   6           6   0.375   0.333    0.5  
#> 44  2019 TEN   AFC   AFC South    16   9           9   0.562   0.5      0.583
#> 45  2019 DEN   AFC   AFC West     16   7           7   0.438   0.5      0.5  
#> 46  2019 KC    AFC   AFC West     16  12          12   0.75    1        0.75 
#> 47  2019 LAC   AFC   AFC West     16   5           5   0.312   0        0.25 
#> 48  2019 OAK   AFC   AFC West     16   7           7   0.438   0.5      0.417
#> 49  2019 DAL   NFC   NFC East     16   8           8   0.5     0.833    0.583
#> 50  2019 NYG   NFC   NFC East     16   4           4   0.25    0.333    0.25 
#> 51  2019 PHI   NFC   NFC East     16   9           9   0.562   0.833    0.583
#> 52  2019 WAS   NFC   NFC East     16   3           3   0.188   0        0.167
#> 53  2019 CHI   NFC   NFC North    16   8           8   0.5     0.667    0.583
#> 54  2019 DET   NFC   NFC North    16   3.5         3   0.219   0        0.208
#> 55  2019 GB    NFC   NFC North    16  13          13   0.812   1        0.833
#> 56  2019 MIN   NFC   NFC North    16  10          10   0.625   0.333    0.583
#> 57  2019 ATL   NFC   NFC South    16   7           7   0.438   0.667    0.5  
#> 58  2019 CAR   NFC   NFC South    16   5           5   0.312   0.167    0.167
#> 59  2019 NO    NFC   NFC South    16  13          13   0.812   0.833    0.75 
#> 60  2019 TB    NFC   NFC South    16   7           7   0.438   0.333    0.417
#> 61  2019 ARI   NFC   NFC West     16   5.5         5   0.344   0.167    0.292
#> 62  2019 LA    NFC   NFC West     16   9           9   0.562   0.5      0.583
#> 63  2019 SEA   NFC   NFC West     16  11          11   0.688   0.5      0.667
#> 64  2019 SF    NFC   NFC West     16  13          13   0.812   0.833    0.833
#> # … with 6 more variables: sov <dbl>, sos <dbl>, div_rank <dbl>, seed <dbl>,
#> #   exit <dbl>, draft_order <dbl>

# Restore old options
options(old)
# }