-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
executable file
·83 lines (66 loc) · 1.9 KB
/
server.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
library(shiny)
library(dplyr)
library(readr)
EdgertronicMaster <- read_csv("EdgertronicMaster.csv")
server <- function(input, output, session) {
output$pitcher <- renderUI({
selectInput("pitcher", "Pitcher", choices = EdgertronicMaster$PITCHER)
})
update <- reactive({
EdgertronicMaster %>%
filter(PITCHER == input$pitcher)
})
output$type <- renderUI({
update <- update()
selectInput("types", "Pitch Type", choices = update$AUTO_PITCH_TYPE)
})
update2 <- reactive({
update <- update()
update %>%
filter(AUTO_PITCH_TYPE == input$types)
})
output$file <- renderUI({
update2 <- update2()
selectInput("file", "File", choices = update2$VideoFile)
})
update3 <- reactive({
update2 <- update2()
update2 %>%
filter(VideoFile == input$file)
})
output$batter <- renderUI({
update3 <- update3()
paste("Batter: ", update3$Batter)
})
output$velo <- renderUI({
update3 <- update3()
paste("Velocity:", round(as.numeric(update3$RELEASE_SPEED),2))
})
output$spin <- renderUI({
update3 <- update3()
paste("Spin: ", round(as.numeric(update3$SPIN_RATE),2))
})
output$axis <- renderUI({
update3 <- update3()
paste("Axis:", round(as.numeric(update3$SPIN_AXIS),2))
})
output$tilt <- renderUI({
update3 <- update3()
paste("Tilt:", update3$TILT_TIME)
})
output$induced <- renderUI({
update3 <- update3()
paste("Induced:", update3$INDUCED_VERTICAL_BREAK)
})
output$vertical <- renderUI({
update3 <- update3()
paste("Vertical Break:", update3$INDUCED_VERTICAL_BREAK)
})
output$horizontal <- renderUI({
update3 <- update3()
paste("Horizontal Break:", update3$HORIZONTAL_BREAK)
})
output$video <- renderUI({
tags$video(id = "video", src = input$file, type = "video/mov", autoplay = NA, controls = TRUE, height = "850px", width = "1050px")
})
}