Easy web applications in R
Shiny makes it super simple for R users like you to turn analyses into interactive web applications that anyone can use. Let your users choose input parameters using friendly controls like sliders, drop-downs, and text fields. Easily incorporate any number of outputs like plots, tables, and summaries.
No HTML or JavaScript knowledge is necessary. If you have some experience with R, you’re just minutes away from combining the statistical power of R with the simplicity of a web page.
Shiny in action
Here’s a basic Shiny application, consisting of less than 40 lines of code.
Try changing the number of bins and toggling the checkboxes.
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)
)
))
Please see our tutorial to learn more about writing Shiny apps.
More examples
Check out more Shiny examples in our showcase.
Getting started
First, install the shiny package by executing this command at your R console:
install.packages('shiny')
Then take a look at our tutorial, which will take you on a step-by-step tour through Shiny. (There’s also documentation in the R package, but we highly recommend you go through most of the tutorial before diving into the function-level documentation.)
Deploying Shiny apps
The Shiny package itself is designed to run Shiny applications locally. To share Shiny applications with other R users, you can send them your application source as a GitHub gist, R package, or zip file (see details).
You can also deploy Shiny applications over the web, so that users need only a web browser and your application’s URL. You’ll need a Linux server and our Shiny Server software, which comes in open source and commercial editions.
If you want to deploy over the web but prefer not to run your own server, we have an open trial of ShinyApps, our subscription-based hosting service for Shiny. To apply for a free beta test account on our hosting service, register now.
Get involved
Join shiny-discuss and let us know if you have any questions/comments, or just want to show off your latest Shiny app!
You can also visit our GitHub repository to get access to the source code and issues database.