Shiny is an R package that allows R users to create interactive web applications without needing to write any HTML, JavaScript or CSS. Building the most basic Shiny apps does not require that much practice or training, however Shiny apps can quickly become more complex and advanced as the list of desired features for your app increases. Advanced functionality typically comes under the following headings:
This OxShef website contains a number of tutorials but should not be considered a resource that will get you from never using Shiny before to building advanced Shiny apps with all of the features above. The following external resources on Shiny are highly recommended:
All tutorials assume you are using RStudio for writing R code. RStudio provides a number of features that make it generally easier to develop Shiny apps than using the R Console.
The Shiny 101 tutorial introduces the very basics of a Shiny app by teaching you how to build the app you can see embedded here.
The code for this app is on the Github repo and the app is embedded into this page using a simple iframe, see here for more details.
Oftentimes controls should be dependent on the data being visualised, for instance restricting a list of countries from a dataset to a specific continent - selected by the user. This is slightly more complicated that you might initially imagine, as the ui.R
file is by definition ignorant of any values from the server.R
other than what is provided on the output
object via render*
functions.
The following example app is explained in this tutorial. It makes use of the gapminder
and rnaturalearthhires
library to introduce the basics of both interdependent and data dependent controls. The code for this Shiny app is on the Github repo and the Shiny app is embedded into this page using a simple iframe, see here for more details.
<!– # Shiny and htmlwidgets
There are a number of features/customisations made to the OxShef Shiny templates, these tutorials introduce how each of them work separately.
This does require some CSS