Shiny

by RStudio
A web application framework for R
Turn your analyses into interactive web applications
No HTML, CSS, or JavaScript knowledge required
Fork me on GitHub

Get inspired
(gallery)

Get started
(tutorial)

Go deeper
(articles)

Here is a Shiny app

Shiny apps are easy to write. No web development skills are required.


shinyUI(bootstrapPage(

  selectInput(inputId = "n_breaks",
      label = "Number of bins in histogram (approximate):",
      choices = c(10, 20, 35, 50),
      selected = 20),

  checkboxInput(inputId = "individual_obs",
      label = strong("Show individual observations"),
      value = FALSE),

  checkboxInput(inputId = "density",
      label = strong("Show density estimate"),
      value = FALSE),

  plotOutput(outputId = "main_plot", height = "300px"),

  # Display this only if the density is shown
  conditionalPanel(condition = "input.density == true",
    sliderInput(inputId = "bw_adjust",
        label = "Bandwidth adjustment:",
        min = 0.2, max = 2, value = 1, step = 0.2)
  )

))
shinyServer(function(input, output) {

  output$main_plot <- renderPlot({

    hist(faithful$eruptions,
      probability = TRUE,
      breaks = as.numeric(input$n_breaks),
      xlab = "Duration (minutes)",
      main = "Geyser eruption duration")

    if (input$individual_obs) {
      rug(faithful$eruptions)
    }

    if (input$density) {
      dens <- density(faithful$eruptions,
          adjust = input$bw_adjust)
      lines(dens, col = "blue")
    }

  })
})

Powerfully interactive

Shiny combines the computational power of R with the interactivity of the modern web.

See dozens of other examples in the gallery.

View gallery

Hosting and deployment

Put your Shiny app on the web by using your own servers or Rstudio's hosting service.

Deploy your apps on-premises
with Shiny Server or Shiny Server Pro

Learn more

Host your apps in the cloud
with ShinyApps.io

Learn more

Ready to jump in?

The best way to start learning Shiny is to work through the tutorial.

Begin tutorial