Skip to content

Creating a new analysis module

Joe Marlo edited this page Sep 26, 2022 · 6 revisions

Creating a new analysis module

Analysis modules should be structured as Shiny modules and follow the golem framework. The process to create a new module is:

  1. Use the dev/02_dev.R script to create a new module template
  2. Write your analysis module
  3. Integrate the module into the main application by placing it in the R/app_ui.R and R/app_server.R files

Adding it the main application

  • app_ui.R: Add code in two places. Follow the pattern in the dashboard body here and dashboard sidebar here
  • app_server.R: Add code in the server following the pattern here
  • Store the module ID in the module_ids object established in the R/utils_global.R file

The store object

Any data that needs to passed between the main server and modules or between modules should be saved to the store object. This is equivalent to "stratégie du petit" in the Engineering Shiny book. The store object should be passed to the module as an argument, and, if modified by the module, should be returned by the module.

Clone this wiki locally