-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path449Scouting2025.qmd
216 lines (164 loc) · 6.21 KB
/
449Scouting2025.qmd
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
---
title: "449 Scouting 2025"
format: html
editor: visual
params:
red1: 449
red2: 451
red3: 456
blue1: 487
blue2: 483
blue3: 453
---
```{r setup, message=FALSE, warning=FALSE}
#rm(list = setdiff(ls(),"params"))
library(tidyverse)
blair_red <- "#a7000a"
red_alliance <- c(params$red1, params$red2, params$red3)
blue_alliance <- c(params$blue1, params$blue2, params$blue3)
raw <- read_csv("made_up_data.csv")
```
BOX PLOT OF ALL TOTAL POINTS
```{r}
boxplot <- raw %>%
filter(team %in% c(red_alliance, blue_alliance)) %>%
mutate(team = factor(team, c(red_alliance,blue_alliance) ))%>%
mutate(total_coral_score =
(coral_L1_num*2) + (coral_L2_num*3) +
(coral_L3_num*4) + (coral_L4_num*5) +
(auto_coral_L1_num*3) + (auto_coral_L2_num*4)+
(auto_coral_L3_num*5)+ (auto_coral_L4_num*7),
total_algea_score =
(robot_net_score*4) + (proc_score*2.5),
total_endgame_score =
ifelse(ending =="D", 12, ifelse(ending=="S",6,ifelse(ending=="P", 2, 0)))
)
boxplot$total = boxplot$total_algea_score + boxplot$total_coral_score+boxplot$total_endgame_score
ggplot(boxplot,aes(x = total, y = as.character(team)))+
geom_boxplot(position = "dodge2", fill = "azure2", ) +
stat_boxplot(geom = "errorbar")+
stat_summary(fun.y = mean, geom="point", size=3, color="orange",)+
# geom_point(aes(x =total_mean, y = team ), color = 'orange', size = 2)
labs(title = "Total points scored",
x = "Point", y = "Team")+
theme_bw()
```
BUBBLE GRAPH OF EVERYTHING
```{r}
bubble <- raw%>%
group_by(team)%>%
summarise(
match = n(),
total_coral_score = sum(
(auto_coral_L1_num*3) + (auto_coral_L2_num*4) + (auto_coral_L3_num*6) + (auto_coral_L4_num*7) +
(coral_L1_num*2) + (coral_L2_num*3) + (coral_L3_num*4)+ (coral_L4_num*5)),
total_algea_score = sum(
(robot_net_score*4) + (proc_score*2.5)),
endgame_score = sum(
ifelse(ending =="D", 12, ifelse(ending =="S",6,ifelse(ending =="P", 2, 0)))),
)
ggplot(bubble, aes(x=total_coral_score, y=total_algea_score, size = endgame_score)) +
geom_point( color = "lightblue2")+
geom_text( aes(label=team, vjust = 1.7 ))+
labs(title = "Teams Performance Summary",
x = "Auto + Tele Coral Points", y = "Total Algea Points", fill = "Auto+End", size = "Endgame")
```
CORAL LEVEL SCORING
```{r}
bar <- raw %>%
filter(team %in% c(red_alliance, blue_alliance)) %>%
mutate(team = factor(team, c(red_alliance,blue_alliance) )) %>%
group_by(team) %>%
summarize(
l1 = mean(coral_L1_num),
l2 = mean(coral_L2_num),
l3 = mean(coral_L3_num),
l4 = mean(coral_L4_num)
)%>%
pivot_longer(cols = c(l4, l3, l2,l1),
names_to = "level",
values_to = "coral_num")
bar$level_score <- case_when(
bar$level == "l1" ~ bar$coral_num*2,
bar$level == "l2" ~ bar$coral_num*3,
bar$level == "l3" ~ bar$coral_num*4,
bar$level == "l4" ~ bar$coral_num*5,
)
ggplot(bar, aes(x = `team`, y = level_score, fill = level)) +
geom_bar(position = "stack", stat = "identity") +
labs(title = "Level Summary",
x = "Team", y = "Coral score", fill = "Level") +
scale_fill_manual(values=c("lightskyblue","royalblue1","royalblue3","navy"))+
theme_bw()
```
CORAL SCORED DURING AUTO AND TELEOP
```{r}
auto_tele <- raw %>%
filter(team %in% c(red_alliance, blue_alliance)) %>%
mutate(team = factor(team, c(red_alliance,blue_alliance) )) %>%
group_by(team) %>%
summarize(
matches = n(),
l1 = mean(coral_L1_num),
l2 = mean(coral_L2_num),
l3 = mean(coral_L3_num),
l4 = mean(coral_L4_num),
autol1 = mean(auto_coral_L1_num),
autol2 = mean(auto_coral_L2_num),
autol3 = mean(auto_coral_L3_num),
autol4 = mean(auto_coral_L4_num)
)%>%
pivot_longer(cols = c(l4, l3, l2,l1,autol1,autol2,autol3,autol4),
names_to = "level",
values_to = "coral_num")
auto_tele$level_score <- case_when(
auto_tele$level == "l1" ~ auto_tele$coral_num*2,
auto_tele$level == "l2" ~ auto_tele$coral_num*3,
auto_tele$level == "l3" ~ auto_tele$coral_num*4,
auto_tele$level == "l4" ~ auto_tele$coral_num*5,
auto_tele$level == "autol1" ~ auto_tele$coral_num*3,
auto_tele$level == "autol2" ~ auto_tele$coral_num*4,
auto_tele$level == "autol3" ~ auto_tele$coral_num*6,
auto_tele$level == "autol4" ~ auto_tele$coral_num*7
)
ggplot(auto_tele, aes(x = `team`, y = (level_score), fill = level)) +
geom_bar(position = "stack", stat = "identity") +
labs(title = "Level Summary",
x = "Team", y = "Coral score", fill = "Level") +
scale_fill_manual(values=c("plum1","plum2","plum3","plum4","steelblue2","steelblue3","steelblue","steelblue4"))+
theme_bw()
```
ENDGAME SCORING
```{r}
end <- raw %>%
filter(team %in% c(red_alliance, blue_alliance)) %>%
mutate(team = factor(team, c(red_alliance,blue_alliance) )) %>%
group_by(team, ending) %>%
summarise(count = n())
end$points <- recode(end$ending, "P" = 2, "S" = 6, "D" = 12, "No" = 0, "F" = 0)
#compute the total end game score from all matches
end$total_points <- end$count * end$points
end$ending <- factor(end$ending, levels = c("D", "S","P","F","No"))
ggplot(end, aes(x =team, y = total_points, fill = ending)) +
geom_bar(position= "stack", stat = "identity") +
labs(title = "Endgame Score",
x = "Team",
y = "Points") +
scale_fill_manual(
values = c("D" = "springgreen4", "S" = "olivedrab3", "P" = "#FFF68F"),
labels = c("D" = "Deep", "S" = "Shallow", "P" = "Park", "ending" = "Cage"),
)
```
```{r}
proc <- read_csv("procReturns.csv")
net <- read_csv("netReturns.csv")
both <- data.frame(Processor = proc[[1]], Net = net[[1]])
both$Index <- seq_len(nrow(both))
ggplot(both, aes(x = Processor, y = Net, label = Index)) +
geom_point(color = blair_red) +
geom_line(color = blair_red) +
geom_text(vjust = -0.5, hjust = 1.2, color = "black") +
geom_abline(slope = 1, intercept = 0, linetype = "dashed", color = "blue") +
labs(x = "Processor Returns", y = "Net Returns", title = "Net Vs Processor") +
theme_minimal()
```