All Mocks are Wrong, but Some are Useful

Author

Nicholas Vietto

Full Description

This table presents the first-round results of the 2024 NFL Draft alongside the final 2024 NFL Mock Draft predictions from the four most popular draft analysts. Although mock drafts offer engaging content throughout the draft season, their accuracy typically declines after the top four picks.

Goal

The purpose of this table was to experiment with {gt} and {gtExtra} to create an engaging data visual

Information on Packages and Data

Data was collected and complied from NFL.com and Sharp Football.

This table was built in R using {gt} and {gtExtras}.

Data wrangling was completed using {janitor}, {readxl}, and {tidyverse}.

Load Packages and Data

Code
pacman::p_load(gt, gtExtras, janitor, tidyverse, readxl)

data <- read_excel("data.xlsx")

Data Wrangling

Code
data <- data |> 
  clean_names() |> 
  as_tibble() |> 
  arrange(actual) |> 
  mutate(across(5:9, as.numeric)) |> 
  mutate(across(everything(), ~ ifelse(is.na(.), 0, .))) |> 
  pivot_longer(cols = -c(players, actual_1, who_was_correct, mean_projection),
               names_to = 'draft',
               values_to = 'position') |>
  group_by(players, actual_1, who_was_correct, mean_projection) |> 
  summarise(positions = list(position)) |> 
  ungroup() |> 
  mutate(mean_projection = as.numeric(mean_projection)) |> 
  mutate(mean_projection_1 = mean_projection) |> 
  mutate(change_score = abs(mean_projection_1 - actual_1)) |> 
  select(players, mean_projection, actual_1, change_score, positions, who_was_correct)


color_palette <- c("#3B9AB2", "#F21A00", "#FF0000")

Table

Code
data |> 
  arrange(actual_1) |> 
  gt() |> 
  tab_header(
    title = md('**All Mocks are Wrong, but Some are Useful**'),
    subtitle = md("*The final 2024 <span style='font-family: Times New Roman;'>**NFL**</span> Mock Drafts from Daniel Jeremiah (DJ), Peter Schrager (PS), Mel Kiper (MK), Bucky Brooks (BB)*")) |> 
  tab_options(
    heading.align = "Center",
    heading.title.font.size = px(24),
    heading.background.color = "#5BBCD6") |> 
  opt_table_font(font = google_font(name = "Playfair Display")) |> 
  cols_label(
    players = 'Player Name',
    actual_1 = 'Actual Draft Position',
    change_score = 'Difference',
    who_was_correct = 'Who Predicted Correctly',
    mean_projection = 'Average Projected Draft Position',
    positions = md('Projected Position <br> (DJ, PS, MK, BB, Actual)'), 
  ) |> 
  gt_plt_sparkline(column = positions, palette = c("#FF0000", "#00A08A", "#F2AD00", "#F98400", "#5BBCD6"))|> 
  gt_color_rows(
    columns = c(actual_1, mean_projection),
    domain = c(0, 100),
    palette = color_palette) |> 
  opt_stylize(style = 6) |> 
  gt_plt_bar_pct(change_score, fill="#5BBCD6", scaled = FALSE) |> 
  cols_align(align = "center", columns = c(mean_projection, actual_1, change_score)) |> 
  tab_source_note(source_note = ("Data: NFL.com and Sharp Football | Table created by Nicholas Vietto for the 2024 Posit Table Contest"))
All Mocks are Wrong, but Some are Useful
The final 2024 NFL Mock Drafts from Daniel Jeremiah (DJ), Peter Schrager (PS), Mel Kiper (MK), Bucky Brooks (BB)
Player Name Average Projected Draft Position Actual Draft Position Difference Projected Position
(DJ, PS, MK, BB, Actual)
Who Predicted Correctly
Caleb Williams 1 1
1.0 All
Jayden Daniels 2 2
2.0 All
Drake Maye 3 3
3.0 All
Marvin Harrison Jr. 4 4
4.0 All
Joe Alt 7 5
5.0 Bucky Brooks
Malik Nabers 6 6
6.0 All
J.C. Lathan 8 7
7.0 None
Michael Penix Jr. 13 8
8.0 None
Rome Odunze 9 9
9.0 Peter Schrager, Mel Kiper, Bucky Brooks
JJ McCarthy 8 10
10.0 None
Olumuyiwa Fashanu 12 11
11.0 None
Bo Nix 17 12
12.0 Peter Schrager
Brock Bowers 11 13
13.0 None
Taliese Fuaga 12 14
14.0 None
Laiatu Latu 24 15
15.0 None
Byron Murphy 14 16
16.0 None
Dallas Turner 10 17
17.0 None
Amarius Mims 20 18
18.0 None
Jared Verse 20 19
19.0 None
Troy Fautanu 17 20
20.0 None
Demeioun 'Chop' Robinson 26 21
21.0 None
Quinyon Mitchell 16 22
22.0 None
Brain Thomas Jr. 23 23
23.0 None
Terrion Arnold 16 24
24.0 None
Jordan Morgan 31 25
25.00 None
Graham Barton 23 26
26.0 Peter Schrager
Darius Robinson 27 27
27.0 Peter Schrager, Mel Kiper, Bucky Brooks
Xavier Worthy 23 28
28.0 None
Tyler Guyton 22 29
29.0 None
Nate Wiggins 24 30
30.0 Daniel Jeremiah
Ricky Pearsall 0 31
31.00 None
Xavier Legette 32 32
32.0 Peter Schrager, Mel Kiper
Data: NFL.com and Sharp Football | Table created by Nicholas Vietto for the 2024 Posit Table Contest