if (interactive()){
library(shiny)
library(shiny.semantic)
ui <- semanticPage(
titlePanel("Hello Shiny!"),
sidebar_layout(
sidebar_panel(
shiny.semantic::sliderInput("obs",
"Number of observations:",
min = 0,
max = 1000,
value = 500),
width = 3
),
main_panel(
plotOutput("distPlot"),
width = 4
),
mirrored = TRUE
)
)
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab