## offense
eliters |>
dplyr::select(team, o_efg, o_twopm, o_twopa, o_twopct, o_ftm, o_fta, o_ft_pct,
o_threepm, o_threepa, o_threepct, o_threerate) |>
dplyr::arrange(-o_efg) |>
cbbplotR::gt_cbb_teams(team, team) |>
gt::gt() |>
gt::fmt_markdown(team) |>
gt::fmt_percent(columns = c(o_twopct, o_ft_pct, o_threepct,
o_efg, o_threerate), decimals = 1) |>
gt::cols_label(
team = "",
o_efg = "eFG",
o_twopm = "2PTM",
o_twopa = "2PTA",
o_twopct = "2PT%",
o_ftm = "FTM",
o_fta = "FTA",
o_ft_pct = "FT%",
o_threepm = "3PTM",
o_threepa = "3PTA",
o_threepct = "3PT%",
o_threerate = "3PTRate"
) |>
cbbplotR::gt_theme_athletic() |>
gt::cols_align(align = "left", columns = c(team)) |>
gt::tab_spanner(columns = c(o_twopm, o_twopa, o_twopct), label = "Two-Pointers") |>
gt::tab_spanner(columns = c(o_ftm, o_fta, o_ft_pct), label = "Free Throws") |>
gt::tab_spanner(columns = c(o_threepm, o_threepa, o_threepct, o_threerate), label = "Three-Pointers") |>
gtExtras::gt_hulk_col_numeric(columns = c(o_twopct, o_ft_pct, o_threepct,
o_efg)) |>
gtExtras::gt_add_divider(columns = c(o_efg, o_twopct, o_ft_pct), sides = "right", color = "black") |>
gt::tab_header(title = "Elite 8 Offense: Team Shooting Performances in NCAA Tournament",
subtitle = gt::html("Shows the shooting splits on offense for teams in the Elite 8 through March 29 games.")) |>
gt::tab_source_note(source_note = gt::html("<hr><b>This is a three-game sample size, so proceed with caution on your hot takes.</b><br><br>Table by Chris (@dadgumboxscores) | Bless your chart <br>
Data from Bart Torvik, cbbdata, and cbbplotR")) |>
gt::tab_style(
locations = gt::cells_title(groups = "subtitle"),
style = gt::cell_text(
size = "small"
)
) |>
gt::tab_style(
locations = gt::cells_source_notes(),
style = gt::cell_text(
size = "x-small"
)
) |>
gt::tab_style(
style = gt::cell_borders(sides = "top", color = 'black', weight = gt::px(1.5), style = 'solid'),
locations = gt::cells_body(
rows = gt::everything()
)
) -> offense
## defense
eliters |>
dplyr::select(team, d_efg, d_twopm, d_twopa, d_twopct, d_ftm, d_fta, d_ft_pct,
d_threepm, d_threepa, d_threepct, d_threerate) |>
dplyr::arrange(d_efg) |>
cbbplotR::gt_cbb_teams(team, team) |>
gt::gt() |>
gt::fmt_markdown(team) |>
gt::fmt_percent(columns = c(d_twopct, d_ft_pct, d_threepct,
d_efg, d_threerate), decimals = 1) |>
gt::cols_label(
team = "",
d_efg = "eFG",
d_twopm = "2PTM",
d_twopa = "2PTA",
d_twopct = "2PT%",
d_ftm = "FTM",
d_fta = "FTA",
d_ft_pct = "FT%",
d_threepm = "3PTM",
d_threepa = "3PTA",
d_threepct = "3PT%",
d_threerate = "3PTRate"
) |>
cbbplotR::gt_theme_athletic() |>
gt::cols_align(align = "left", columns = c(team)) |>
gt::tab_spanner(columns = c(d_twopm, d_twopa, d_twopct), label = "Two-Pointers") |>
gt::tab_spanner(columns = c(d_ftm, d_fta, d_ft_pct), label = "Free Throws") |>
gt::tab_spanner(columns = c(d_threepm, d_threepa, d_threepct, d_threerate), label = "Three-Pointers") |>
gtExtras::gt_hulk_col_numeric(columns = c(d_twopct, d_ft_pct, d_threepct,
d_efg), reverse = TRUE) |>
gtExtras::gt_add_divider(columns = c(d_efg, d_twopct, d_ft_pct), sides = "right", color = "black") |>
gt::tab_header(title = "Elite 8 Defense: Team Shooting Performances in NCAA Tournament",
subtitle = gt::html("Shows the shooting splits on defense for teams in the Elite 8 through March 29 games.")) |>
gt::tab_source_note(source_note = gt::html("<hr><b>This is a three-game sample size, so proceed with caution on your hot takes.</b><br><br>Table by Chris (@dadgumboxscores) | Bless your chart <br>
Data from Bart Torvik, cbbdata, and cbbplotR")) |>
gt::tab_style(
locations = gt::cells_title(groups = "subtitle"),
style = gt::cell_text(
size = "small"
)
) |>
gt::tab_style(
locations = gt::cells_source_notes(),
style = gt::cell_text(
size = "x-small"
)
) |>
gt::tab_style(
style = gt::cell_borders(sides = "top", color = 'black', weight = gt::px(1.5), style = 'solid'),
locations = gt::cells_body(
rows = gt::everything()
)
) -> defense
gtExtras::gtsave_extra(offense,
filename = "e8off.png",
vheight = 650,
vwidth = 950)
gtExtras::gtsave_extra(defense,
filename = "e8def.png",
vheight = 650,
vwidth = 950)
offense