I am trying to create an application with the shiny. My application was running well before but it's now producing this error below.
**ERROR: unused argument (mainPanel(plotOutput("myplot")))
MY CODE FOR THE ui.R FILE IS AS BELOW :
shiny server(
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:",1))
),
mainPanel(
plotOutput("myplot")
)
)
FOR THE SERVER FILE CODE IS AS BELOW:
shinyServer(
function(input, output, session){
Output$myplot <-renderPlot({
disType <- input$Distribution
size <- input$SampleSize
If(disType == "Normal"){
randomVec <-rnorm(size, mean=as.numeric(input$mean),sd=as.numeric(input$sd))
}
else{
randomVec <- rexp(size, rate= 1/ as.numeric(input$lambda))
}
hist(randomVec, col="blue")
})
}