Spaces:
Sleeping
Sleeping
Update app.R
Browse files
app.R
CHANGED
|
@@ -264,6 +264,14 @@ FSL25 <- download_private_parquet("TimStats/StatcastDataAll", "FSL25.parquet")
|
|
| 264 |
FSL25$level <- "FSL"
|
| 265 |
#ST <- read.csv("SpringT25.csv", header = TRUE, check.names = FALSE, fileEncoding = "UTF-8")
|
| 266 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
#names(ST)
|
| 268 |
MLB <- download_private_parquet("TimStats/StatcastDataAll", "MLB.parquet")
|
| 269 |
MLB$level <- "MLB"
|
|
@@ -271,12 +279,14 @@ AAA <- download_private_parquet("TimStats/StatcastDataAll", "AAA.parquet")
|
|
| 271 |
AAA$level <- "AAA"
|
| 272 |
FSLAll <- download_private_parquet("TimStats/StatcastDataAll", "FSL.parquet")
|
| 273 |
FSLAll$level <- "FSL"
|
| 274 |
-
MLB <- rbind(MLB,MLB25)
|
| 275 |
-
|
| 276 |
-
|
|
|
|
|
|
|
| 277 |
|
| 278 |
|
| 279 |
-
temp_players <- MLB %>% filter(season ==
|
| 280 |
MLBC <- rbind(MLB,AAA,FSLAll)
|
| 281 |
data <- is_barrel(MLBC) %>%
|
| 282 |
mutate(
|
|
@@ -384,7 +394,7 @@ server <- function(input, output,session) {
|
|
| 384 |
titlePanel(NULL, windowTitle = "Baseball Stats Visualization"),
|
| 385 |
sidebarLayout(
|
| 386 |
sidebarPanel(
|
| 387 |
-
selectInput("szn", "Season:", c(2025, 2024, 2023, 2022, 2021, 2021)),
|
| 388 |
selectInput("level", "Level:", c("MLB", "AAA", "FSL")),
|
| 389 |
selectInput("type", "Player Type:", c("Batter", "Pitcher")),
|
| 390 |
selectInput("player", "Player:", choices = unique(temp_players$`Batter Name`)),
|
|
@@ -565,8 +575,8 @@ server <- function(input, output,session) {
|
|
| 565 |
|
| 566 |
indv <- data %>% filter(`Batter Name` == input$player,level == input$level)
|
| 567 |
#if(indv[1,5] >= 149){
|
| 568 |
-
if(input$szn ==
|
| 569 |
-
qual <- data %>% filter(BIP >
|
| 570 |
}
|
| 571 |
else{
|
| 572 |
qual <- data %>% filter(BIP > 249)
|
|
|
|
| 264 |
FSL25$level <- "FSL"
|
| 265 |
#ST <- read.csv("SpringT25.csv", header = TRUE, check.names = FALSE, fileEncoding = "UTF-8")
|
| 266 |
|
| 267 |
+
MLB26 <- download_private_parquet("TimStats/StatcastDataAll", "MLB26.parquet")
|
| 268 |
+
MLB26$level <- "MLB"
|
| 269 |
+
AAA26 <- download_private_parquet("TimStats/StatcastDataAll", "AAA26.parquet")
|
| 270 |
+
AAA26$level <- "AAA"
|
| 271 |
+
#FSL26 <- download_private_parquet("TimStats/StatcastDataAll", "FSL26.parquet")
|
| 272 |
+
#FSL26$level <- "FSL"
|
| 273 |
+
|
| 274 |
+
|
| 275 |
#names(ST)
|
| 276 |
MLB <- download_private_parquet("TimStats/StatcastDataAll", "MLB.parquet")
|
| 277 |
MLB$level <- "MLB"
|
|
|
|
| 279 |
AAA$level <- "AAA"
|
| 280 |
FSLAll <- download_private_parquet("TimStats/StatcastDataAll", "FSL.parquet")
|
| 281 |
FSLAll$level <- "FSL"
|
| 282 |
+
MLB <- rbind(MLB,MLB25,MLB26)
|
| 283 |
+
print("aaa")
|
| 284 |
+
AAA <- rbind(AAA,AAA25,AAA26)
|
| 285 |
+
print("fsl")
|
| 286 |
+
FSL <- rbind(FSL,FSL25)
|
| 287 |
|
| 288 |
|
| 289 |
+
temp_players <- MLB %>% filter(season == 2026)
|
| 290 |
MLBC <- rbind(MLB,AAA,FSLAll)
|
| 291 |
data <- is_barrel(MLBC) %>%
|
| 292 |
mutate(
|
|
|
|
| 394 |
titlePanel(NULL, windowTitle = "Baseball Stats Visualization"),
|
| 395 |
sidebarLayout(
|
| 396 |
sidebarPanel(
|
| 397 |
+
selectInput("szn", "Season:", c(2026,2025, 2024, 2023, 2022, 2021, 2021)),
|
| 398 |
selectInput("level", "Level:", c("MLB", "AAA", "FSL")),
|
| 399 |
selectInput("type", "Player Type:", c("Batter", "Pitcher")),
|
| 400 |
selectInput("player", "Player:", choices = unique(temp_players$`Batter Name`)),
|
|
|
|
| 575 |
|
| 576 |
indv <- data %>% filter(`Batter Name` == input$player,level == input$level)
|
| 577 |
#if(indv[1,5] >= 149){
|
| 578 |
+
if(input$szn == 2026){
|
| 579 |
+
qual <- data %>% filter(BIP > 10)
|
| 580 |
}
|
| 581 |
else{
|
| 582 |
qual <- data %>% filter(BIP > 249)
|