Spaces:
Sleeping
Sleeping
Upload app.R
Browse files
app.R
CHANGED
|
@@ -3,7 +3,7 @@ library(plotly)
|
|
| 3 |
library(gridlayout)
|
| 4 |
library(bslib)
|
| 5 |
library(DT)
|
| 6 |
-
|
| 7 |
library(baseballr)
|
| 8 |
library(dplyr)
|
| 9 |
library(tidyverse)
|
|
@@ -14,8 +14,7 @@ library(ggthemes)
|
|
| 14 |
library(ggpubr)
|
| 15 |
library(jsonlite)
|
| 16 |
library(utils)
|
| 17 |
-
|
| 18 |
-
#library(magick)
|
| 19 |
|
| 20 |
VAA <- function(milbtotal){
|
| 21 |
milbtotal <- milbtotal |>
|
|
@@ -198,7 +197,7 @@ ui <- grid_page(
|
|
| 198 |
area = "header",
|
| 199 |
content = "2024 MLB/AAA/FSL Summary Cards (BETA)",
|
| 200 |
alignment = "start",
|
| 201 |
-
is_title =
|
| 202 |
),
|
| 203 |
grid_card(
|
| 204 |
area = "area2",
|
|
@@ -265,13 +264,13 @@ server <- function(input, output) {
|
|
| 265 |
})
|
| 266 |
observeEvent(input$update,{
|
| 267 |
if(input$level == "AAA"){
|
| 268 |
-
pname <- aaaid |>
|
| 269 |
filter(date == input$date) |>
|
| 270 |
filter(teams_home_team_name == input$homeT) |>
|
| 271 |
filter(teams_away_team_name == input$awayT) |>
|
| 272 |
-
filter(game_number == input$gamenum)
|
| 273 |
-
pname <- tryCatch({pitcher_summary(pname[,6])},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 274 |
-
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:",choices = pname[,3])
|
| 275 |
}
|
| 276 |
if(input$level == "FSL"){
|
| 277 |
pname <- fslid |>
|
|
@@ -292,13 +291,13 @@ server <- function(input, output) {
|
|
| 292 |
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:",choices = pname[,3])
|
| 293 |
}
|
| 294 |
if(input$level == "Spring Breakout"){
|
| 295 |
-
pname <- sbid |>
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
pname <- tryCatch({pitcher_summary(pname[,6])},error=function(e){cat("ERROR :",conditionMessage(e), "\n")})
|
| 301 |
-
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:",choices = pname[,3])
|
| 302 |
}
|
| 303 |
})
|
| 304 |
observeEvent(input$update1,{
|
|
|
|
| 3 |
library(gridlayout)
|
| 4 |
library(bslib)
|
| 5 |
library(DT)
|
| 6 |
+
library(rsconnect)
|
| 7 |
library(baseballr)
|
| 8 |
library(dplyr)
|
| 9 |
library(tidyverse)
|
|
|
|
| 14 |
library(ggpubr)
|
| 15 |
library(jsonlite)
|
| 16 |
library(utils)
|
| 17 |
+
library(magick)
|
|
|
|
| 18 |
|
| 19 |
VAA <- function(milbtotal){
|
| 20 |
milbtotal <- milbtotal |>
|
|
|
|
| 197 |
area = "header",
|
| 198 |
content = "2024 MLB/AAA/FSL Summary Cards (BETA)",
|
| 199 |
alignment = "start",
|
| 200 |
+
is_title = FALSE
|
| 201 |
),
|
| 202 |
grid_card(
|
| 203 |
area = "area2",
|
|
|
|
| 264 |
})
|
| 265 |
observeEvent(input$update,{
|
| 266 |
if(input$level == "AAA"){
|
| 267 |
+
pname <- reactive(aaaid |>
|
| 268 |
filter(date == input$date) |>
|
| 269 |
filter(teams_home_team_name == input$homeT) |>
|
| 270 |
filter(teams_away_team_name == input$awayT) |>
|
| 271 |
+
filter(game_number == input$gamenum))
|
| 272 |
+
pname <- reactive(tryCatch({pitcher_summary(pname()[,6])},error=function(e){cat("ERROR :",conditionMessage(e), "\n")}))
|
| 273 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:",choices = pname()[,3])
|
| 274 |
}
|
| 275 |
if(input$level == "FSL"){
|
| 276 |
pname <- fslid |>
|
|
|
|
| 291 |
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:",choices = pname[,3])
|
| 292 |
}
|
| 293 |
if(input$level == "Spring Breakout"){
|
| 294 |
+
pname <- reactive(sbid |>
|
| 295 |
+
filter(date == input$date) |>
|
| 296 |
+
filter(teams_home_team_name == input$homeT) |>
|
| 297 |
+
filter(teams_away_team_name == input$awayT) |>
|
| 298 |
+
filter(game_number == input$gamenum))
|
| 299 |
+
pname <- reactive(tryCatch({pitcher_summary(pname()[,6])},error=function(e){cat("ERROR :",conditionMessage(e), "\n")}))
|
| 300 |
+
updateSelectizeInput(session = getDefaultReactiveDomain(),"pitcher","Pitcher:",choices = pname()[,3])
|
| 301 |
}
|
| 302 |
})
|
| 303 |
observeEvent(input$update1,{
|