library(cbbplotR)library(rlang)url <-"https://www.teamrankings.com/college-football/stat/seconds-per-play?date=2024-09-18"webpage <- rvest::read_html(url)pace <- webpage |> rvest::html_node("table") |> rvest::html_table() |> dplyr::mutate(diff =`2023`-`2024`) |> dplyr::select(Team, `2024`, `2023`, diff)slow_pace <- pace |> dplyr::arrange(diff) |> dplyr::slice(1:10) |> dplyr::mutate(Team = dplyr::case_match( Team,"W Michigan"~"Western Michigan","N Carolina"~"North Carolina","Middle Tenn"~"Middle Tennessee State","Colorado St"~"Colorado State", Team ~ Team ) ) |> cbbplotR::gt_cbb_teams(Team, Team) |> dplyr::mutate(category ="Slower")fast_pace <- pace |> dplyr::arrange(-diff) |> dplyr::slice(1:10) |> dplyr::mutate(Team = dplyr::case_match( Team,"Miss State"~"Mississippi State","San Diego St"~"San Diego State","TX El Paso"~"UTEP","San Jose St"~"San Jose State","E Carolina"~"ECU", Team ~ Team ) ) |> cbbplotR::gt_cbb_teams(Team, Team) |> dplyr::mutate(category ="Faster")all_pace_teams <- fast_pace |> dplyr::bind_rows(slow_pace)
GT Table for pace differences
Code
custom_header <- glue::glue("<div style='display: flex; justify-content: space-between; align-items: center;'> <div> <img src='https://img.pikbest.com/png-images/qiantu/cartoon-small-alarm-clock-png-download_2689861.png' style='height: 65px; width: auto; vertical-align: middle;'> </div> <div style='flex-grow:1; margin-left: 30px; margin-right: 30px'> <span style='display: block; font-weight: bold; text-align: center; font-size: 24px;'>College football<br> Teams playing <em>faster</em> and <em>slower</em></span> <span style='font-size: 14px; font-weight: normal; display: block; text-align: center;'>Shows the ten fastest and slowest teams compared to seconds per play on offense from last season to this season.</span> </div> <div> <img src='https://a.espncdn.com/combiner/i?img=/redesign/assets/img/icons/ESPN-icon-football-college.png' style='height: 45px; width: auto; vertical-align: middle;'> </div> </div> <br>")delta_tbl <- all_pace_teams |> dplyr::select(Team, `2024`, diff, `2023`, category) |> dplyr::group_by(category) |> gt::gt() |> gt::fmt_number(columns =c(`2024`, `2023`, diff), decimals =1) |> gt::fmt_markdown(Team) |> gtUtils::gt_theme_savant() |> gt::cols_align(columns =c(-Team), "center") |> gt::cols_align(columns =c(Team), "left") |> gt::tab_options(column_labels.border.top.style ="none") |> gtUtils::gt_column_subheaders(`2024`=list(heading ="2024", subtitle ="Season"),`2023`=list(heading ="2023", subtitle ="Season"),diff =list(heading ="+/-", subtitle ="Change"),heading_color ="black",subtitle_color ="gray" ) |> gt::cols_label(Team ="") |> gtExtras::gt_hulk_col_numeric(columns =c(diff), domain =c(-10, 10)) |> gtUtils::gt_538_caption("<hr>Data via TeamRankings, theme via {gtUtils}, and logos from ESPN.com. <br>2024 season data through September 14 games.","Table by Chris (@dadgumboxscores) + Bless your chart" ) |> gt::tab_header(title = gt::html(custom_header)) |> gt::tab_options(table.width = gt::px(550)) |> gtUtils::gt_border_grid(color ="black",weight =1,include_labels =FALSE)gtUtils::gt_save_crop(delta_tbl,file ="delta_tbl.png",whitespace =40,bg ="white")delta_tbl
College football Teams playing faster and slowerShows the ten fastest and slowest teams compared to seconds per play on offense from last season to this season.
1
2024
Season
1
+/-
Change
1
2023
Season
1
Faster
Mississippi St.
19.7
7.0
26.7
San Diego St.
23.5
6.1
29.6
Pittsburgh
20.6
5.5
26.1
Wyoming
24.6
4.9
29.5
Connecticut
23.9
4.8
28.7
East Carolina
21.0
4.7
25.7
Miami OH
27.0
3.8
30.8
UTEP
24.0
3.6
27.6
Duke
23.9
3.4
27.3
San Jose St.
25.4
3.3
28.7
Slower
Louisiana Lafayette
34.4
−7.8
26.6
UCLA
30.3
−7.2
23.1
Louisiana Monroe
31.2
−6.7
24.5
Army
37.4
−6.4
31.0
Illinois
30.3
−6.3
24.0
Middle Tennessee
29.8
−5.8
24.0
Colorado St.
27.7
−5.3
22.4
Western Michigan
28.9
−5.0
23.9
North Carolina
27.4
−4.9
22.5
Temple
28.0
−4.5
23.5
Table by Chris (@dadgumboxscores) + Bless your chart
1
Data via TeamRankings, theme via {gtUtils}, and logos from ESPN.com. 2024 season data through September 14 games.