Update app.R
Browse files
app.R
CHANGED
|
@@ -349,26 +349,6 @@ FSL_processed <- FSL %>%
|
|
| 349 |
mutate('Batter Home/Away' = ifelse(`Batter Team` == teams_home_team_name,"Home","Away")) %>%
|
| 350 |
mutate('Pitcher Home/Away' = ifelse(`Pitcher Team` == teams_home_team_name,"Home","Away"))
|
| 351 |
|
| 352 |
-
ST_processed <- ST %>%
|
| 353 |
-
calculate_timstuff() %>%
|
| 354 |
-
addChecks()%>%
|
| 355 |
-
VAA()%>%
|
| 356 |
-
mutate('Pitch Name' = pitch_name) %>%
|
| 357 |
-
mutate('Season' = season) %>%
|
| 358 |
-
mutate('Level' = "Spring Training") %>%
|
| 359 |
-
mutate('Pitch Type' = case_when(
|
| 360 |
-
pitch_name %in% c("Four-Seam Fastball", "Sinker", "Cutter", "Fastball") ~ "Fastball",
|
| 361 |
-
pitch_name %in% c("Slider", "Sweeper", "Slurve", "Curveball", "Screwball",
|
| 362 |
-
"Knuckle Curve", "Slow Curve", "Eephus") ~ "Breaking",
|
| 363 |
-
pitch_name %in% c("Changeup", "Splitter", "Forkball") ~ "Offspeed",
|
| 364 |
-
TRUE ~ NA_character_ # Corrected default case
|
| 365 |
-
))%>%
|
| 366 |
-
mutate('Batter Side' = bside) %>%
|
| 367 |
-
mutate('Pitcher Hand' = phand) %>%
|
| 368 |
-
mutate('Stadium' = venue_name) %>%
|
| 369 |
-
mutate('Batter Home/Away' = ifelse(`Batter Team` == teams_home_team_name,"Home","Away")) %>%
|
| 370 |
-
mutate('Pitcher Home/Away' = ifelse(`Pitcher Team` == teams_home_team_name,"Home","Away"))
|
| 371 |
-
|
| 372 |
# Available stats for the UI
|
| 373 |
available_stats <- c("Pitches", "Avg Velo", "Top Velo", "TimStuff", "Max EV", "Avg EV",
|
| 374 |
"EV90", "Avg LA", "stdevLA", "HardHit%", "Barrel%", "SwSpt%",
|
|
@@ -460,8 +440,7 @@ server <- function(input, output, session) {
|
|
| 460 |
combined_data <- bind_rows(
|
| 461 |
if ("MLB" %in% input$level) MLB_processed,
|
| 462 |
if ("AAA" %in% input$level) AAA_processed,
|
| 463 |
-
if ("FSL" %in% input$level) FSL_processed
|
| 464 |
-
if ("Spring Training(2025)" %in% input$level) ST_processed
|
| 465 |
) %>%
|
| 466 |
filter(between(as.Date(date), input$date_range[1], input$date_range[2]))
|
| 467 |
# First group and calculate all stats
|
|
|
|
| 349 |
mutate('Batter Home/Away' = ifelse(`Batter Team` == teams_home_team_name,"Home","Away")) %>%
|
| 350 |
mutate('Pitcher Home/Away' = ifelse(`Pitcher Team` == teams_home_team_name,"Home","Away"))
|
| 351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
# Available stats for the UI
|
| 353 |
available_stats <- c("Pitches", "Avg Velo", "Top Velo", "TimStuff", "Max EV", "Avg EV",
|
| 354 |
"EV90", "Avg LA", "stdevLA", "HardHit%", "Barrel%", "SwSpt%",
|
|
|
|
| 440 |
combined_data <- bind_rows(
|
| 441 |
if ("MLB" %in% input$level) MLB_processed,
|
| 442 |
if ("AAA" %in% input$level) AAA_processed,
|
| 443 |
+
if ("FSL" %in% input$level) FSL_processed
|
|
|
|
| 444 |
) %>%
|
| 445 |
filter(between(as.Date(date), input$date_range[1], input$date_range[2]))
|
| 446 |
# First group and calculate all stats
|