column_headers <-c("bball_win_pct", "overall_fb_win_pct")img_urls <-c("https://a.espncdn.com/combiner/i?img=/redesign/assets/img/icons/ESPN-icon-basketball.png","https://a.espncdn.com/combiner/i?img=/redesign/assets/img/icons/ESPN-icon-football-college.png")add_header <-function(col_name, img_url) { gtExtras::img_header(label ="",img_url = img_url,height =25,palette =c("white") )}col_headers_with_images <- purrr::map2(column_headers, img_urls, add_header) |> purrr::set_names(column_headers)cup_tbl <- all_sports |> dplyr::filter(top_ten >14.5) |> dplyr::arrange(-top_ten) |> cbbplotR::gt_cbb_teams(team, team) |> gt::gt() |> gtUtils::gt_theme_gtutils() |> gt::fmt_markdown(team) |> gt::cols_align(team, align ="left") |> gt::cols_label(team ="", !!!col_headers_with_images) |> gtUtils::gt_color_pills( bball_win_pct,domain =c(.3, .85),format_type ="percent",digits =1,palette =c("#8B0000", "#FF0000", "#FF4500", "#ADFF2F", "#008000"), ) |> gtUtils::gt_color_pills( overall_fb_win_pct,domain =c(.3, .85),format_type ="percent",digits =1,palette =c("#8B0000", "#FF0000", "#FF4500", "#ADFF2F", "#008000"), ) |> gt::cols_nanoplot(columns = all_fb_win_pct,reference_line = .5,autohide =TRUE,autoscale =TRUE,options = gt::nanoplot_options(data_area_fill_color ="lightpink",reference_line_color ="#333333",show_data_area =TRUE,data_line_type ="curved",show_data_points =FALSE ) ) |> gt::cols_label(team ="",top_ten ="Top 10s",nanoplots ="Football Win %: 1993 to 2024" ) |> gtExtras::gt_add_divider(columns =c(team, bball_win_pct),sides ="right",color ="black") |> gt::tab_header(title = gt::html("Win percentage in football and men's basketball since 1993-94 for public schools with most Top 10 Finishes in Directors' Cup<hr>")) |> gt::tab_source_note(source_note = gt::html("<hr>Data from wikipedia.com, stathead.com, {cfbfastR}, and theme for {gtUtils}. Idea from Neil Paine.<br>The Directors' Cup is a competition between athletic departments that ranks schools based on performance across all men’s and women’s varsity sports<br> <hr><b>Table by Chris at Bless your chart | December 13, 2024</b>" ) ) |> gt::tab_style(style =list(gt::cell_text(font = gt::google_font("Signika Negative"))),locations = gt::cells_body(columns = team) ) |> gt::tab_style(locations = gt::cells_column_labels(),style = gt::cell_text(font = gt::google_font("Signika Negative"),weight =850,size = gt::px(15) ) ) |> gt::tab_style(locations = gt::cells_source_notes(),style = gt::cell_text(font = gt::google_font("Signika Negative"),size = gt::px(10),weight =250 ) ) |> gt::tab_style(locations = gt::cells_column_spanners(),style = gt::cell_text(font = gt::google_font("Signika Negative"),weight =850,size = gt::px(15) ) ) |> gtExtras::gt_highlight_rows(rows =c(2),columns =c(1:4),fill ="#FFFFC5") |> gt::tab_options(table.width = gt::px(725)) gtUtils::gt_save_crop( cup_tbl,file ="cup_tbl.png",whitespace =30,bg ="#FFFDF5" ) cup_tbl
Win percentage in football and men's basketball since 1993-94 for public schools with most Top 10 Finishes in Directors' Cup
Top 10s
Football Win %: 1993 to 2024
Florida
30
67.5%
70.5%
North Carolina
25
73.0%
53.8%
Texas
25
65.9%
68.6%
UCLA
24
68.2%
54.6%
Texas A&M
23
55.0%
62.3%
Michigan
23
60.1%
70.0%
Tennessee
20
61.7%
64.5%
Florida St.
20
57.2%
71.4%
Nebraska
19
50.6%
64.9%
Ohio St.
15
63.7%
82.7%
Data from wikipedia.com, stathead.com, {cfbfastR}, and theme for {gtUtils}. Idea from Neil Paine.
The Directors' Cup is a competition between athletic departments that ranks schools based on performance across all men’s and women’s varsity sports Table by Chris at Bless your chart | December 13, 2024
`summarise()` has grouped output by 'conf', 'opp_conf'. You can override using
the `.groups` argument.
CFB Conference table
Code
custom_header <- glue::glue("<div style='display: flex; justify-content: space-between; align-items: center;'> <div> <img src='https://a.espncdn.com/combiner/i?img=/i/teamlogos/ncaa_conf/500/sec.png' style='height: 45px; 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: 18px;'>SEC Non-Conference games by opponent conference during the 2024 season</span> <span style='font-size: 12px; font-weight: normal; display: block; text-align: center;'>Shows the total number of games against each opponent's conference grouped by FBS or non-FBS.</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>")sec_tbl <- sec_games |> dplyr::group_by(fbs_conf) |> dplyr::arrange(-total_games) |> gt::gt() |> gt::cols_hide(conf) |> gtExtras::gt_theme_dot_matrix() |> gtExtras::gt_add_divider(columns =c(opp_conf),sides ="right",color ="black") |> gt::cols_align(columns =c(opp_conf),align ="left") |> gt::tab_header(title = gt::html(custom_header)) |> gt::tab_source_note(source_note = gt::html("<hr>Data from {cfbfastR} and theme via {gtUtils}<hr> <b>Table by Chris at Bless your chart | December 13, 2024</b>" ) ) |> gt::cols_label(opp_conf ="",total_games ="Total Games", ) |> gt::tab_options (source_notes.font.size = gt::px(10),row.striping.background_color ='#EEEEEE',table.font.size = gt::px(12),column_labels.text_transform ='uppercase',column_labels.font.weight ="bold",column_labels.font.size = gt::px(12),table.width = gt::px(450) ) |> gt::tab_style(locations = gt::cells_row_groups(),style =list( gt::cell_text(font = gt::google_font("Courier"),weight =850,size = gt::px(16),color ="black",align ="left" ), gt::cell_fill(color ="#C5C5FF" ) ) ) |> gt::tab_style(locations = gt::cells_source_notes(),style = gt::cell_text(font = gt::google_font("Courier"),size = gt::px(11.5),weight =250 ) ) |> gt::tab_style(style =list( gt::cell_text(font = gt::google_font("Courier") ) ),locations = gt::cells_body(columns =c(opp_conf) ) ) |> gtUtils::gt_border_bars_bottom(c("#22356B", "#ffffff", "#FBCE28")) gtUtils::gt_save_crop( sec_tbl,file ="sec_tbl.png",whitespace =30,bg ="#FFFDF5" ) sec_tbl
SEC Non-Conference games by opponent conference during the 2024 seasonShows the total number of games against each opponent's conference grouped by FBS or non-FBS.
Total Games
FBS
ACC
11
Mid-American
7
Sun Belt
7
American Athletic
5
Conference USA
5
Big 12
4
Big Ten
4
FBS Independents
4
Mountain West
2
Non-FBS
Southern
5
SWAC
3
MVFC
2
Southland
2
Big South-OVC
1
CAA
1
UAC
1
Data from {cfbfastR} and theme via {gtUtils}
Table by Chris at Bless your chart | December 13, 2024