Skip to content

Instantly share code, notes, and snippets.

@Nicolabo
Created January 4, 2018 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nicolabo/7d0a75740ef1a95ceda4a026c0ba13d5 to your computer and use it in GitHub Desktop.
Save Nicolabo/7d0a75740ef1a95ceda4a026c0ba13d5 to your computer and use it in GitHub Desktop.
library(shiny)
options(shiny.autoreload = TRUE)
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
})
library(shiny)
fluidPage(
titlePanel("Old Faithful Geyser Datass"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
mainPanel(
plotOutput("distPlot")
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment