Code
::cbd_torvik_game_stats(conf = "ACC", opp_conf = "ACC", year = "2024") -> new_acc cbbdata
January 6, 2024
# add conf title odds
cbb_logo_links <- cbbdata::cbd_teams() |>
dplyr::pull('logo') |>
rlang::set_names(cbbdata::cbd_teams()$common_team)
new_acc |>
dplyr::group_by(team) |>
dplyr::summarise(
wins = sum(result == "W"),
loss = sum(result == "L"),
delta = sum(pts - opp_pts),
home_wins = sum(result == "W" & location == "H"),
home_loss = sum(result == "L" & location == "H"),
home_delta = sum((pts - opp_pts) * (location == "H")),
away_wins = sum(result == "W" & location == "A"),
away_loss = sum(result == "L" & location == "A"),
away_delta = sum((pts - opp_pts) * (location == "A"))
) |>
dplyr::arrange(-delta,-wins) |>
dplyr::mutate(
row_number = 1:dplyr::n(),
team = dplyr::case_match(
team,
"Florida St." ~ "Florida State",
"North Carolina St." ~ "NC State",
"Miami FL" ~ "Miami",
team ~ team
)
) |>
dplyr::mutate(team_name = team) |>
dplyr::relocate(team_name, .before = wins) |>
dplyr::relocate(row_number, .before = team) |>
cbbplotR::gt_cbb_teams(
team_column = "team",
logo_column = "team",
include_name = FALSE
) |>
gt::gt() |>
gt::fmt_markdown(columns = "team") |>
gt::cols_label(
row_number = "",
team_name = "",
team = "",
delta = "+/-",
wins = "W",
loss = "L",
home_wins = "W",
home_loss = "L",
home_delta = "+/-",
away_wins = "W",
away_loss = "L",
away_delta = "+/-"
) |>
gt::tab_spanner(label = "Overall",
columns = c(wins, loss, delta)) |>
gt::tab_spanner(label = "Home",
columns = c(home_wins, home_loss, home_delta)) |>
gt::tab_spanner(label = "Away",
columns = c(away_wins, away_loss, away_delta)) |>
gt::fmt(
columns = c(delta, home_delta, away_delta),
fns = function(x) {
ifelse(x > 0, paste0("+", x), x)
}
) |>
cbbdata::gt_theme_athletic() |>
gt::cols_align(align = "left", columns = "team_name") |>
gt::data_color(
columns = c(delta, home_delta, away_delta),
colors = scales::col_numeric(
c(
"#ff8396",
"#ffb6c1",
"#fff1f3",
"#d2f8d2",
"#b0f3b0",
"#84ec84"
),
domain = c(-50, 50)
)
) |>
gt::tab_header(title = "ACC Basketball: 2024 Conference Standings",
subtitle = "Win/loss and point differential by location in conference play only through January 6 games.") |>
gt::tab_source_note(source_note = "Bless your chart | January 7, 2024 | data: cbbdata + cbbplotR") -> acc_hoops
gtExtras::gtsave_extra(acc_hoops,
filename = "acc_table.png",
vheight = 875,
vwidth = 650)
acc_hoops
ACC Basketball: 2024 Conference Standings | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Win/loss and point differential by location in conference play only through January 6 games. | |||||||||||
Overall | Home | Away | |||||||||
W | L | +/- | W | L | +/- | W | L | +/- | |||
1 | Wake Forest | 3 | 0 | +33 | 2 | 0 | +27 | 1 | 0 | +6 | |
2 | North Carolina | 3 | 0 | +31 | 1 | 0 | +8 | 2 | 0 | +23 | |
3 | NC State | 3 | 0 | +24 | 1 | 0 | +16 | 2 | 0 | +8 | |
4 | Duke | 2 | 1 | +24 | 1 | 0 | +20 | 1 | 1 | +4 | |
5 | Miami | 2 | 1 | +22 | 2 | 0 | +26 | 0 | 1 | -4 | |
6 | Virginia | 2 | 2 | +8 | 2 | 0 | +46 | 0 | 2 | -38 | |
7 | Florida State | 2 | 1 | +6 | 2 | 0 | +14 | 0 | 1 | -8 | |
8 | Notre Dame | 1 | 3 | -1 | 1 | 2 | +12 | 0 | 1 | -13 | |
9 | Boston College | 1 | 2 | -4 | 0 | 2 | -12 | 1 | 0 | +8 | |
10 | Clemson | 1 | 2 | -14 | 0 | 1 | -10 | 1 | 1 | -4 | |
11 | Georgia Tech | 1 | 2 | -15 | 1 | 1 | -4 | 0 | 1 | -11 | |
12 | Pittsburgh | 1 | 3 | -17 | 0 | 2 | -22 | 1 | 1 | +5 | |
13 | Virginia Tech | 1 | 2 | -19 | 1 | 0 | +7 | 0 | 2 | -26 | |
14 | Syracuse | 1 | 2 | -34 | 1 | 0 | +8 | 0 | 2 | -42 | |
15 | Louisville | 0 | 3 | -44 | 0 | 1 | -13 | 0 | 2 | -31 | |
Bless your chart | January 7, 2024 | data: cbbdata + cbbplotR |