Spaces:
Runtime error
Runtime error
Update app.R
Browse files
app.R
CHANGED
|
@@ -195,19 +195,19 @@ summary_table <- function(data) {
|
|
| 195 |
combined_data <- current_summary %>%
|
| 196 |
left_join(data_2024, by = c("Pitcher Name", "Pitcher ID", "pitch_name")) %>%
|
| 197 |
mutate(
|
| 198 |
-
'Velo_Diff' = round(Velo -
|
| 199 |
-
'Spin_Diff' = round(Spin -
|
| 200 |
-
'Ext_Diff' = round(Ext -
|
| 201 |
# IVB calculation modified to handle sign changes correctly
|
| 202 |
-
'IVB_Diff' = round(ifelse(sign(IVB) != sign(
|
| 203 |
-
sign(IVB) * (abs(IVB) + abs(
|
| 204 |
ifelse(IVB < 0,
|
| 205 |
-
-1 * (abs(IVB) - abs(
|
| 206 |
-
abs(IVB) - abs(
|
| 207 |
# HB shows increased movement in either direction as positive
|
| 208 |
-
'HB_Diff' = round(abs(HB) - abs(
|
| 209 |
-
'RelX_Diff' = round(RelX -
|
| 210 |
-
'RelZ_Diff' = round(RelZ -
|
| 211 |
) %>%
|
| 212 |
arrange(-Pitches)
|
| 213 |
|
|
|
|
| 195 |
combined_data <- current_summary %>%
|
| 196 |
left_join(data_2024, by = c("Pitcher Name", "Pitcher ID", "pitch_name")) %>%
|
| 197 |
mutate(
|
| 198 |
+
'Velo_Diff' = round(Velo - Velo25, 1),
|
| 199 |
+
'Spin_Diff' = round(Spin - Spin25, 1),
|
| 200 |
+
'Ext_Diff' = round(Ext - Ext25, 1),
|
| 201 |
# IVB calculation modified to handle sign changes correctly
|
| 202 |
+
'IVB_Diff' = round(ifelse(sign(IVB) != sign(IVB25),
|
| 203 |
+
sign(IVB) * (abs(IVB) + abs(IVB25)),
|
| 204 |
ifelse(IVB < 0,
|
| 205 |
+
-1 * (abs(IVB) - abs(IVB25)),
|
| 206 |
+
abs(IVB) - abs(IVB25))), 1),
|
| 207 |
# HB shows increased movement in either direction as positive
|
| 208 |
+
'HB_Diff' = round(abs(HB) - abs(HB25), 1),
|
| 209 |
+
'RelX_Diff' = round(RelX - RelX25, 1),
|
| 210 |
+
'RelZ_Diff' = round(RelZ - RelZ25, 1)
|
| 211 |
) %>%
|
| 212 |
arrange(-Pitches)
|
| 213 |
|