TimStats commited on
Commit
94bc168
·
verified ·
1 Parent(s): 7664bf2

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +3 -3
app.R CHANGED
@@ -163,13 +163,13 @@ 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
- # 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)
 
163
  'Velo_Diff' = round(Velo - Velo24, 1),
164
  'Spin_Diff' = round(Spin - Spin24, 1),
165
  'Ext_Diff' = round(Ext - Ext24, 1),
166
+ # IVB calculation modified to handle sign changes correctly
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 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)