Shinyscholar – a template for creating reproducible Shiny applications in R
Abstract
Shiny is a framework for producing apps in R that is an increasingly popular method for academics to develop software. However a survey of apps published in 2023 found they typically fail to facilitate reproducible research or provide attribution to software developers.Additionally, academics often have little formal training in software development and consequently apps fail to adhere to best practices in structuring code and automated testing. To address these shortcomings, we present Shinyscholar (https://cran.r-project.org/package=shinyscholar) as a framework built upon Shiny which provides a suite of features tailored to the production of academic Shiny apps. Developed by forking WallaceEcoMod (an app for modelling species distributions with many desirable features) and the addition of extra features, Shinyscholar generates a template app structured as an R package where an analysis is broken down into steps with multiple options for each step. Analyses from generated apps can be saved and loaded at any point, a file can be downloaded that completely reproduces the analysis and developers of dependent software are appropriately cited. Other features include a flexible system for reporting messages to users, structures for providing user guidance, the ability to view source code from inside the application and a walk-through to guide new users. The visible structure of the app is reflected in the structure of the code, with each possible option in the analysis composed of a Shiny module that calls one function, facilitating maintenance and automated testing. The talk will explain how to create a new app and the workflow for developing modules. By using Shinyscholar, to create an app, developers can concentrate on creating domain-specific functionality rather than enabling communication between modules or designing user interfaces and will be more able to produce apps that follow best practices, are maintainable, and run reliably.Acknowledgements Shinyscholar was created by forking WallaceEcoMod and we are grateful for those developers for creating much of the functionality. Funding to develop Shinyscholar was provided by Wellcome.A recording of this session is available on YouTube: https://youtu.be/8YPXUE5qy_w