TimStats commited on
Commit
7664bf2
·
verified ·
1 Parent(s): 22400e2

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +8 -7
app.R CHANGED
@@ -163,13 +163,14 @@ summary_table <- function(data) {
163
  'Velo_Diff' = round(Velo - Velo24, 1),
164
  'Spin_Diff' = round(Spin - Spin24, 1),
165
  'Ext_Diff' = round(Ext - Ext24, 1),
166
- # For IVB and HB: Handle sign changes and apply sign based on current year
167
- 'IVB_Diff' = round(sign(IVB) * ifelse(sign(IVB) != sign(IVB24),
168
- abs(IVB) + abs(IVB24),
169
- abs(IVB) - abs(IVB24)), 1),
170
- 'HB_Diff' = round(sign(HB) * ifelse(sign(HB) != sign(HB24),
171
- abs(HB) + abs(HB24),
172
- abs(HB) - abs(HB24)), 1),
 
173
  'RelX_Diff' = round(RelX - RelX24, 1),
174
  'RelZ_Diff' = round(RelZ - RelZ24, 1)
175
  ) %>%
 
163
  'Velo_Diff' = round(Velo - Velo24, 1),
164
  'Spin_Diff' = round(Spin - Spin24, 1),
165
  'Ext_Diff' = round(Ext - Ext24, 1),
166
+ # IVB keeps original logic
167
+ 'IVB_Diff' = round(ifelse(sign(IVB) != sign(IVB24),
168
+ -sign(IVB) * (abs(IVB) + abs(IVB24)),
169
+ ifelse(IVB < 0,
170
+ -1 * (abs(IVB) - abs(IVB24)),
171
+ abs(IVB) - abs(IVB24))), 1),
172
+ # HB now shows increased movement in either direction as positive
173
+ 'HB_Diff' = round(abs(HB) - abs(HB24), 1),
174
  'RelX_Diff' = round(RelX - RelX24, 1),
175
  'RelZ_Diff' = round(RelZ - RelZ24, 1)
176
  ) %>%