Hi everyone. I am new in Shiny.I am trouble with publishing shiny application. As soon as Shiny app is opened, it is closed shiny app window. Codes of my shiny app is below. I
#theme_hc()
#theme_economist()
#tibble(v1=rnorm(input$n[2]))
library(ggthemes)
library(colourpicker)
ui<-dashboardPage(skin = "green",
dashboardHeader(title = "Normal Dağılıma Uygun Örneklem Seçimi", titleWidth = 350),
dashboardSidebar(width = 350,
sliderInput(inputId="n", label="Örneklem Büyüklüğü",min=0, max=1000, value = c(0, 1000)),
textInput(inputId="title", "Title of ...."),
colourInput(inputId="color", "Renk seçiniz", value="Green"),
actionButton(inputId = "cal", width =270 ,label = "Yenile", icon = icon("stats",lib='glyphicon'),class = "btn-info"),
hr()),
dashboardBody(
fluidRow(
valueBoxOutput("value1")
,valueBoxOutput("value2")
,valueBoxOutput("value3")
),
plotOutput("box")))
server<-function(input, output, session){
#some data manipulation to derive the values of KPI boxes
input$cal
p<-tibble(v1=rnorm(input$n[2]))
ort <- sum(rnorm(p$v1))
var <- var(rnorm(p$v1))
sd<- sd(rnorm(p$v1))
#creating the valueBoxOutput content
output$value1 <- renderValueBox({
valueBox(
formatC(ort,format = "fg", width = 11, big.mark = "'"), "Toplam"
,icon = icon("stats",lib='glyphicon')
,color = "purple")
})
output$value2 <- renderValueBox({
valueBox(formatC(var,format = "fg", width = 11, big.mark = "'"),"Ortalama"
,icon = icon("stats",lib='glyphicon')
,color = "green")
})
output$value3 <- renderValueBox({
valueBox(
formatC(sd,format = "fg", width = 11, big.mark = "'"),"Standart Sapma"
,icon = icon("stats",lib='glyphicon')
,color = "yellow")
})
output$box <- renderPlot({
ggplot(p, aes(x=v1)) +
geom_histogram(color="black", fill=input$color)+
geom_vline(aes(xintercept=mean(v1)),
color="blue", linetype="dashed", size=1)+
labs(title=input$title,x="Örneklem Büyüklüğü", y = "Frekans")+
#paste(input$tm,"()", sep="")
theme_economist()
})
}
shinyApp(ui, server)