Hello, I am trying to use the shiny app to make a program that predicts what someones run time will be based off an inputted height. This is all based off data that was collected and compiled in an xlxs. file. I cannot get the program to run, my code is attached below.
Server code:
shinyServer(
function(input, output, sessionInfo){
output$myPlot <- renderPlot({
distType <- input$Distribution
size <- input$sampleSize
if(distType == "Normal"){
randomVec <- rnorm(size, mean = as.numeric(input$))
}
else {
randomVec <- rnorm(size, mean = as.numeric(input$mean), sd=as.numeric(input$sd))
}
hist(randomVec, col="blue")
})
}
)
UI code:
shinyServer(
pageWithSidebar(
headerPanel("My First Shiny App"),
sidebarPanel(
selectInput("Distribution", "Please Select Distribution Type",
choices=c("Normal", "Exponential")),
sliderInput ("sampleSize", "Please Select Sample Size: ",
min=100, max=5000, value= 1000, step=100 ),
conditionalPanel(condition = "input.Distribution == 'Normal'",
textInput("mean","Please Select the mean",10),
textInput("sd","Please Select Standard Deviation"),3),
conditionalPanel(condition = "input.Distribution == 'Exponential'",
textInput("lambda", "Please Select Exponential Lambda:",
),
mainPanel(
plotOutput("myPlot")
)
)
)))