TimStats commited on
Commit
59773a8
·
verified ·
1 Parent(s): 00dd220

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +10 -10
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 - Velo24, 1),
199
- 'Spin_Diff' = round(Spin - Spin24, 1),
200
- 'Ext_Diff' = round(Ext - Ext24, 1),
201
  # IVB calculation modified to handle sign changes correctly
202
- 'IVB_Diff' = round(ifelse(sign(IVB) != sign(IVB24),
203
- sign(IVB) * (abs(IVB) + abs(IVB24)),
204
  ifelse(IVB < 0,
205
- -1 * (abs(IVB) - abs(IVB24)),
206
- abs(IVB) - abs(IVB24))), 1),
207
  # HB shows increased movement in either direction as positive
208
- 'HB_Diff' = round(abs(HB) - abs(HB24), 1),
209
- 'RelX_Diff' = round(RelX - RelX24, 1),
210
- 'RelZ_Diff' = round(RelZ - RelZ24, 1)
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