schedule |>
dplyr::filter(!is.na(Home_Score)) |>
dplyr::filter(Home %in% c("Boston College", "Clemson", "Florida St.",
"Georgia Tech", "Miami (FL)", "NC State", "Pittsburgh")) |>
dplyr::pull(Game_ID) -> home_ids
schedule |>
dplyr::filter(!is.na(Home_Score)) |>
dplyr::filter(Away %in% c("Clemson", "Florida St.", "Duke", "Louisville",
"Wake Forest", "Syracuse")) |>
dplyr::pull(Game_ID) -> away_ids
acc_ids <- c(away_ids, home_ids)
acc_only <- schedule |>
dplyr::filter(Game_ID %in% acc_ids)
acc_pbp <-bigballR::get_play_by_play(acc_only$Game_ID)
acc_lineups <- bigballR::get_lineups(play_by_play_data = acc_pbp)
# now cross-check last two lineups
last_two_pbp <-bigballR::get_play_by_play(acc_only$Game_ID[12:13])
last_two_lineups <- bigballR::get_lineups(play_by_play_data = last_two_pbp)
unc_last_two <- last_two_lineups |>
dplyr::filter(Team == "North Carolina") |>
dplyr::rowwise() |>
dplyr::mutate_at(
c("P1", "P2", "P3", "P4", "P5"),
~ stringr::str_to_title(stringr::str_split(., "\\.", simplify = TRUE)) |>
stringr::str_c(collapse = " ")
) |>
dplyr::select(P1:P5, Mins) |>
dplyr::mutate(MinPct = Mins / 80) -> no_trimble
# first 11 games
first_acc_pbp <-bigballR::get_play_by_play(acc_only$Game_ID[1:11])
first_acc_lineups <- bigballR::get_lineups(play_by_play_data = first_acc_pbp)
unc_first_acc <- first_acc_lineups |>
dplyr::filter(Team == "North Carolina") |>
dplyr::rowwise() |>
dplyr::mutate_at(
c("P1", "P2", "P3", "P4", "P5"),
~ stringr::str_to_title(stringr::str_split(., "\\.", simplify = TRUE)) |>
stringr::str_c(collapse = " ")
) |>
dplyr::select(P1:P5, Mins) |>
dplyr::mutate(MinPct = Mins / (11*40)) -> with_trimble
with_trimble |>
dplyr::mutate(dplyr::across(c("P1", "P2", "P3", "P4", "P5"),
~dplyr::case_when(
.x == "Rj Davis" ~ "RJ Davis",
.x == "Jaelyn Withers" ~ "Jae'Lyn Withers",
TRUE ~ .x
)
)
) |>
dplyr::arrange(-Mins) |>
dplyr::ungroup() |>
dplyr::slice(1:5) -> trim_table
# no trimble
no_trimble |>
dplyr::mutate(dplyr::across(c("P1", "P2", "P3", "P4", "P5"),
~dplyr::case_when(
.x == "Rj Davis" ~ "RJ Davis",
.x == "Jaelyn Withers" ~ "Jae'Lyn Withers",
TRUE ~ .x
)
)
) |>
dplyr::arrange(-Mins) |>
dplyr::ungroup() -> no_trim_table