

The multiple files set up may be easier to navigate for more complicated apps with many lines of code. Alternatively, you can also create separate ui.R and server.R files (“Multiple Files” option) in a dedicated directory, which you can then run using the runApp() function. With this option, you will keep all of your app’s code in a single r script, which is easiest for new users and for building relatively simple apps. To get started creating your app, create a new file by going to “New file” -> “Shiny Web App”, enter the name of your app, and select “Single File”. In this example, we’ll also be using the shinyWidgets package, which offers additional user inputs to use in your app, dslabs, which contains the example dataset we will use, plotly, for interactive graphs, and tidyverse, for data manipulation. To get started, you’ll need to install the shiny package in R. Take a look at the app, play with it, and then come back and build it yourself! The finished app is available at the following link.

In this article we walk you through the steps of building a shiny app for visualizing disease occurrence in the United States from 1928-2011. Among its many uses, shiny apps are a great way for researchers to engage others with their work and collected data. Visit R studio’s shiny gallery to view some examples.

They can be written purely with R code or supplemented with HTML, CSS, or JavaScript. Shiny apps can range from extremely simple to incredibly sophisticated. Shiny is an R package that facilitates the creation of interactive web apps using R code, which can be hosted locally, on the shinyapps server, or on your own server.
