Spaces:
Sleeping
Sleeping
Update app.R
Browse files
app.R
CHANGED
|
@@ -190,8 +190,8 @@ ui <- grid_page(
|
|
| 190 |
selectizeInput("homeT","Home Team:",mlbteamH[,1]),
|
| 191 |
selectizeInput("awayT", "Away Team:",mlbteamA[,1]),
|
| 192 |
selectizeInput("gamenum","Game Number (For Doubleheaders):",c("1","2")),
|
| 193 |
-
actionButton("update","Find Pitchers",icon("magnifying-glass"),
|
| 194 |
-
|
| 195 |
selectizeInput("pitcher","Pitcher Name:",c(" ")),
|
| 196 |
selectizeInput("league","MLB or MiLB Photo",c("MLB","MiLB")),
|
| 197 |
textInput("title","Card Title"),
|
|
@@ -305,6 +305,82 @@ server <- function(input, output) {
|
|
| 305 |
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 306 |
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 307 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
})
|
| 309 |
observeEvent(input$update1,{
|
| 310 |
if(input$level == "MLB"){
|
|
|
|
| 190 |
selectizeInput("homeT","Home Team:",mlbteamH[,1]),
|
| 191 |
selectizeInput("awayT", "Away Team:",mlbteamA[,1]),
|
| 192 |
selectizeInput("gamenum","Game Number (For Doubleheaders):",c("1","2")),
|
| 193 |
+
#actionButton("update","Find Pitchers",icon("magnifying-glass"),
|
| 194 |
+
# style = "color: #FFFFFF; background-color: #0077B6"),
|
| 195 |
selectizeInput("pitcher","Pitcher Name:",c(" ")),
|
| 196 |
selectizeInput("league","MLB or MiLB Photo",c("MLB","MiLB")),
|
| 197 |
textInput("title","Card Title"),
|
|
|
|
| 305 |
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 306 |
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 307 |
}
|
| 308 |
+
})
|
| 309 |
+
observeEvent(input$homeT,{
|
| 310 |
+
if(input$level == "AAA"){
|
| 311 |
+
pname <- aaaid |>
|
| 312 |
+
filter(date == input$date) |>
|
| 313 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 314 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 315 |
+
filter(game_number == input$gamenum)
|
| 316 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 317 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 318 |
+
}
|
| 319 |
+
if(input$level == "FSL"){
|
| 320 |
+
pname <- fslid |>
|
| 321 |
+
filter(date == input$date) |>
|
| 322 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 323 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 324 |
+
filter(game_number == input$gamenum)
|
| 325 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 326 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 327 |
+
}
|
| 328 |
+
if(input$level == "MLB"){
|
| 329 |
+
pname <- mlbid |>
|
| 330 |
+
filter(date == as.character.Date(input$date)) |>
|
| 331 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 332 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 333 |
+
filter(game_number == input$gamenum)
|
| 334 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 335 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 336 |
+
}
|
| 337 |
+
if(input$level == "Spring Breakout"){
|
| 338 |
+
pname <- sbid |>
|
| 339 |
+
filter(date == input$date) |>
|
| 340 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 341 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 342 |
+
filter(game_number == input$gamenum)
|
| 343 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 344 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 345 |
+
}
|
| 346 |
+
})
|
| 347 |
+
observeEvent(input$gamenum,{
|
| 348 |
+
if(input$level == "AAA"){
|
| 349 |
+
pname <- aaaid |>
|
| 350 |
+
filter(date == input$date) |>
|
| 351 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 352 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 353 |
+
filter(game_number == input$gamenum)
|
| 354 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 355 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 356 |
+
}
|
| 357 |
+
if(input$level == "FSL"){
|
| 358 |
+
pname <- fslid |>
|
| 359 |
+
filter(date == input$date) |>
|
| 360 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 361 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 362 |
+
filter(game_number == input$gamenum)
|
| 363 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 364 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 365 |
+
}
|
| 366 |
+
if(input$level == "MLB"){
|
| 367 |
+
pname <- mlbid |>
|
| 368 |
+
filter(date == as.character.Date(input$date)) |>
|
| 369 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 370 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 371 |
+
filter(game_number == input$gamenum)
|
| 372 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 373 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 374 |
+
}
|
| 375 |
+
if(input$level == "Spring Breakout"){
|
| 376 |
+
pname <- sbid |>
|
| 377 |
+
filter(date == input$date) |>
|
| 378 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 379 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 380 |
+
filter(game_number == input$gamenum)
|
| 381 |
+
pname <- tryCatch({pitcher_summary(pname[,6],input$date)},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 382 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:(For Spring Breakout if pitchers not loading, try changing game number)",choices = pname[,3])
|
| 383 |
+
}
|
| 384 |
})
|
| 385 |
observeEvent(input$update1,{
|
| 386 |
if(input$level == "MLB"){
|