-
Notifications
You must be signed in to change notification settings - Fork 0
/
Illini Basketball 2023-24
51 lines (42 loc) · 1.73 KB
/
Illini Basketball 2023-24
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
install.packages("hoopR")
library(hoopR)
library(tidyverse)
library(dplyr)
library(readr)
library(ggplot2)
library(ggrepel)
library(tidyr)
library(ggimage)
progressr::with_progress({
mbb_pbp <- hoopR::load_mbb_pbp(2024)
})
View(mbb_pbp)
timeouts = subset(mbb_pbp,type_text %in% c("ShortTimeOut", "End Game", "End Period", "OfficialTVTimeOut"))
View(timeouts)
progressr::with_progress({
mbb_stats_team <- hoopR::load_mbb_team_box()
})
progressr::with_progress({
mbb_stats_team_other <- hoopR::load_mbb_player_box()
})
illinois = subset(mbb_pbp, away_team_name %in% c("Illinois") | home_team_name %in% c("Illinois"))
illinois_team_stats = subset(mbb_stats_team, team_location %in% c("Illinois"))
illinois_player_stats = subset(mbb_stats_team_other, team_location %in% c("Illinois"))
illinois_sr_advanced = read.csv("C:\\Users\\imksy\\Documents\\illini advanced sr.csv")
illini_top8 <- illinois_sr_advanced %>%
filter(MP >= 400)
ggplot(illini_top8, aes(x = PER, y = BPM, label = Player, size = MP)) +
geom_point(color = "orange") +
geom_text_repel(max.overlaps = 50) + # Adjust the label position if needed
#geom_vline(xintercept = avg_un_p2s, linetype = "dashed") +
#geom_hline(yintercept = avg_epa_play, linetype = "dashed") +
labs(x = "Player Efficiency Rating (PER)", y = "Box Plus/Minus +/- (BPM)", title = "Fighting Illini Basketball 2023-24 BPM vs PER") +
scale_y_continuous(limits = c(3, 12), breaks = seq(3, 12, by = 3)) +
scale_x_continuous(limits = c(10, 30), breaks = seq(10, 30, by = 4)) +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5),
panel.grid.major = element_line(color = "gray", linetype = "dashed"),
legend.position = "none"
)
#https://x.com/TotallyREALSpo1/status/1795319305883775223