TimStats commited on
Commit
747c262
·
verified ·
1 Parent(s): 2b9277c

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +11 -11
app.R CHANGED
@@ -4,6 +4,16 @@ library(ggplot2)
4
  library(utils)
5
 
6
  data1 <- read.csv("data1.csv", header = TRUE, check.names = FALSE, fileEncoding = "UTF-8")
 
 
 
 
 
 
 
 
 
 
7
 
8
  pitch_type_lookup <- data.frame(
9
  pitch_name = c("Changeup", "Curveball", "Cutter", "Eephus", "Forkball",
@@ -307,7 +317,7 @@ ui <- fluidPage(
307
  width = 3,
308
  selectInput("player", "Select Player:", choices = unique(data1$`Pitcher Name`),
309
  width = "100%"),
310
- dateRangeInput("date1", "Date Range:",
311
  start = "2024-02-09",
312
  end = "2024-09-05",
313
  width = "100%"),
@@ -330,16 +340,6 @@ ui <- fluidPage(
330
 
331
  # Define server
332
  server <- function(input, output) {
333
-
334
- AAaveragePT <- data1 %>%
335
- mutate(arm_angle = round(arm_angle, digits = 0)) %>%
336
- group_by(arm_angle, phand, pitch_name) %>%
337
- summarise(
338
- AvgIVB = mean(IVB, na.rm = TRUE),
339
- AvgHB = mean(HB, na.rm = TRUE),
340
- .groups = 'drop'
341
- )
342
-
343
 
344
  filtered_data <- eventReactive(input$submit, {
345
  data1 %>%
 
4
  library(utils)
5
 
6
  data1 <- read.csv("data1.csv", header = TRUE, check.names = FALSE, fileEncoding = "UTF-8")
7
+ data2 <- data2[,2:54]
8
+
9
+ AAaveragePT <- data1 %>%
10
+ mutate(arm_angle = round(arm_angle, digits = 0)) %>%
11
+ group_by(arm_angle, phand, pitch_name) %>%
12
+ summarise(
13
+ AvgIVB = mean(IVB, na.rm = TRUE),
14
+ AvgHB = mean(HB, na.rm = TRUE),
15
+ .groups = 'drop'
16
+ )
17
 
18
  pitch_type_lookup <- data.frame(
19
  pitch_name = c("Changeup", "Curveball", "Cutter", "Eephus", "Forkball",
 
317
  width = 3,
318
  selectInput("player", "Select Player:", choices = unique(data1$`Pitcher Name`),
319
  width = "100%"),
320
+ dateRangeInput("date1", "Dates: (Be wary of multi year plots as arm angles may change)",
321
  start = "2024-02-09",
322
  end = "2024-09-05",
323
  width = "100%"),
 
340
 
341
  # Define server
342
  server <- function(input, output) {
 
 
 
 
 
 
 
 
 
 
343
 
344
  filtered_data <- eventReactive(input$submit, {
345
  data1 %>%