Example Shiny application adopting the recommendations of "Ten Quick Tips for Developing a Reproducible Shiny Application", Brun et al, 2025, PLOS Computational Biology.
In this example, we are reusing the Faithful Shiny app example provided as part of the R shiny package. This Shiny application displays eruption duration in minutes for the Old Faithful geyser.
- Set up your computing environment
- Use git and GitHub
- Use
renv
to record package versions - Record the output of
sessionInfo()
- Document and develop incrementally
- Comment UI elements
- Make your Shiny application modular and portable
- Organize code and data
- Use relative paths and
file.path
- Preprocess and cache data for performance
- Cache remotely-accessed and processed data in a local file
- Make underlying data accessible
- Cite the original data
- License code and data appropriately
- Add a LICENSE file
- Respect the license of the original data
- Make your data and source code citable
- Add a suggested citation to the README
- Add a CITATION.cff file
- Share your app
- Publish on shinyapps.io and archive in Zenodo
- Clone this repository and run at the R console:
shiny::runApp()
- At the R console run:
shiny::runGitHub(repo="shiny-qt-example", "UCSB-Library-Research-Data-Services")
This repository has the following file structure:
├── CITATION.cff
├── data
│ ├── faithful_data.csv
│ └── metadata.md
├── global.R
├── LICENSE
├── README.md
├── renv
│ ├── activate.R
│ ├── library
│ ├── settings.json
│ └── staging
├── renv.lock
├── server.R
├── sessionInfo.txt
├── shiny-qt-example.Rproj
└── ui.R
global.R
: Load libraries and check for existing data filesserver.R
: server side functions of the Shiny app used to compute the histogram plot and other plot featuresui.R
: user interface of the Shiny app
This app uses renv to create a virtual environment
renv.lock
: list of the R packages used by the virtual environment.Rprofile
: ensures that the library is used every time you open that projectrenv/activate.R
: R script sourced by.Rprofile
to activate the virtual environmentrenv/settings.json
: virtual environment settings
faithful_data.csv
: CSV file version of the faithful data from the datasets R packagemetadata.md
: metadata information about faithful_data.csv
The underlying data is available as part of R package datasets. The version used is distributed with R 4.5.0. This version is a simplification
of the original data collected by Azzalini, A. and Bowman, A. W. (1990). See metadata.md
in the data
directory for more information.
Cite this work as: Brun, J., Janée, G., & Curty, R. G. (2025). Example Shiny application adopting the recommendations from "Ten Quick Tips for Developing a Reproducible Shiny Application" [Computer software]. https://github.com/UCSB-Library-Research-Data-Services/shiny-qt-examples