Skip to content

Instantly share code, notes, and snippets.

@wch
Created November 6, 2012 02:25
Show Gist options
  • Select an option

  • Save wch/4022167 to your computer and use it in GitHub Desktop.

Select an option

Save wch/4022167 to your computer and use it in GitHub Desktop.
Basic histogram example
library(shiny)
shinyServer(function(input, output) {
output$main_plot <- reactivePlot(function() {
hist(faithful$waiting,
breaks = as.numeric(input$n_breaks),
xlab = "Time to next eruption (minutes)",
main = "Waiting times for Old Faithful geyser")
})
})
library(shiny)
shinyUI(bootstrapPage(
selectInput(inputId = "n_breaks",
label = "Approximate number of bins:",
choices = c(5, 10, 20, 40)),
plotOutput(outputId = "main_plot")
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment