Spaces:
Runtime error
Runtime error
Update app.R
Browse files
app.R
CHANGED
|
@@ -74,7 +74,7 @@ is_barrel <- function(df) {
|
|
| 74 |
apply_percentile_calcs <- function(data) {
|
| 75 |
# List of columns to apply percent_rank
|
| 76 |
percent_rank_cols <- c("Z-Con%", "Z-Swing%", "O-Con%", "Avg EV", "Max EV", "EV90", "Barrel%", "Swing%", "wOBA",
|
| 77 |
-
"wOBACON","xwOBA","
|
| 78 |
|
| 79 |
# List of columns to apply inverse percent_rank
|
| 80 |
inverse_percent_rank_cols <- c("Chase%", "Whiff%", "stdev(LA)", "SwStr%")
|
|
@@ -264,7 +264,7 @@ data <- is_barrel(MLBC) %>%
|
|
| 264 |
sum(Triple,na.rm = TRUE) * 1.59 + sum(`Home Run`,na.rm = TRUE) * 2.05 )/
|
| 265 |
sum(BBE,na.rm = TRUE), 3),
|
| 266 |
xwOBA = round(mean(expected_woba,na.rm = TRUE), 3),
|
| 267 |
-
|
| 268 |
`Avg EV` = round(mean(hit_speed,na.rm = TRUE), 1),
|
| 269 |
EV90 = round(quantile(hit_speed,0.9,na.rm = TRUE), 1),
|
| 270 |
`Max EV` = round(max(hit_speed,na.rm = TRUE), 1),
|
|
|
|
| 74 |
apply_percentile_calcs <- function(data) {
|
| 75 |
# List of columns to apply percent_rank
|
| 76 |
percent_rank_cols <- c("Z-Con%", "Z-Swing%", "O-Con%", "Avg EV", "Max EV", "EV90", "Barrel%", "Swing%", "wOBA",
|
| 77 |
+
"wOBACON","xwOBA","xDamage")
|
| 78 |
|
| 79 |
# List of columns to apply inverse percent_rank
|
| 80 |
inverse_percent_rank_cols <- c("Chase%", "Whiff%", "stdev(LA)", "SwStr%")
|
|
|
|
| 264 |
sum(Triple,na.rm = TRUE) * 1.59 + sum(`Home Run`,na.rm = TRUE) * 2.05 )/
|
| 265 |
sum(BBE,na.rm = TRUE), 3),
|
| 266 |
xwOBA = round(mean(expected_woba,na.rm = TRUE), 3),
|
| 267 |
+
xDamage = round(mean(expected_woba[BBE == TRUE],na.rm = TRUE), 3),
|
| 268 |
`Avg EV` = round(mean(hit_speed,na.rm = TRUE), 1),
|
| 269 |
EV90 = round(quantile(hit_speed,0.9,na.rm = TRUE), 1),
|
| 270 |
`Max EV` = round(max(hit_speed,na.rm = TRUE), 1),
|