Spaces:
Runtime error
Runtime error
Update app.R
Browse files
app.R
CHANGED
|
@@ -44,7 +44,9 @@ ui <- fluidPage(
|
|
| 44 |
|
| 45 |
# Show a plot of the generated distribution
|
| 46 |
mainPanel(
|
| 47 |
-
textOutput("
|
|
|
|
|
|
|
| 48 |
)
|
| 49 |
)
|
| 50 |
)
|
|
@@ -52,7 +54,7 @@ ui <- fluidPage(
|
|
| 52 |
# Define server logic required to draw a histogram
|
| 53 |
server <- function(input, output) {
|
| 54 |
|
| 55 |
-
output$
|
| 56 |
data <- as.data.frame(5)
|
| 57 |
setnames(data,"5","start_speed")
|
| 58 |
data$start_speed <- input$velo
|
|
@@ -82,6 +84,36 @@ server <- function(input, output) {
|
|
| 82 |
# vip(FBMod)
|
| 83 |
return(TimStuff)
|
| 84 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
}
|
| 86 |
|
| 87 |
# Run the application
|
|
|
|
| 44 |
|
| 45 |
# Show a plot of the generated distribution
|
| 46 |
mainPanel(
|
| 47 |
+
textOutput("stuff")
|
| 48 |
+
textOutput ("rv")
|
| 49 |
+
|
| 50 |
)
|
| 51 |
)
|
| 52 |
)
|
|
|
|
| 54 |
# Define server logic required to draw a histogram
|
| 55 |
server <- function(input, output) {
|
| 56 |
|
| 57 |
+
output$stuff <- renderText({
|
| 58 |
data <- as.data.frame(5)
|
| 59 |
setnames(data,"5","start_speed")
|
| 60 |
data$start_speed <- input$velo
|
|
|
|
| 84 |
# vip(FBMod)
|
| 85 |
return(TimStuff)
|
| 86 |
})
|
| 87 |
+
output$rv <- renderText({
|
| 88 |
+
data <- as.data.frame(5)
|
| 89 |
+
setnames(data,"5","start_speed")
|
| 90 |
+
data$start_speed <- input$velo
|
| 91 |
+
data$IVB <- input$ivb
|
| 92 |
+
if(input$phand == "L"){
|
| 93 |
+
data$HB <- input$hb * -1
|
| 94 |
+
}
|
| 95 |
+
else{
|
| 96 |
+
data$HB <- input$hb
|
| 97 |
+
}
|
| 98 |
+
data$EAA <- input$ext / 6.3
|
| 99 |
+
if(input$phand == "L"){
|
| 100 |
+
data$x0 <- input$x0 * -1
|
| 101 |
+
}
|
| 102 |
+
else{
|
| 103 |
+
data$x0 <- input$x0
|
| 104 |
+
}
|
| 105 |
+
data$z0 <- input$z0
|
| 106 |
+
data$spin_rate <- input$spinrate
|
| 107 |
+
data$SADiff <- input$spinaxisdiff
|
| 108 |
+
|
| 109 |
+
data <- as.matrix(data)
|
| 110 |
+
FBMod <- xgb.load('FB.model')
|
| 111 |
+
prediction <-predict(FBMod,data)
|
| 112 |
+
TimStuff <- (50 - (prediction - -0.0004397118)/ 0.2180433 * 10)
|
| 113 |
+
# FBMod <- xgb.load("FB.model")
|
| 114 |
+
# vip(FBMod)
|
| 115 |
+
return(Prediction)
|
| 116 |
+
})
|
| 117 |
}
|
| 118 |
|
| 119 |
# Run the application
|