Code developed by Epi-interactive (www.epi-interactive.com)
CLIENT: World Health Organization (WHO)
PROJECT: GLASS Dashboard
DATE: 26/05/2025
The GLASS dashboard displays AMU, AMR and CTA profiles data through interactive visualisations. The dashboard includes image, data and pdf downloads
As of 26/05/2025: The project was built with R version: 4.4.3
This project uses the renv library to manage package versions and dependencies.
For a list of packages required for this project, refer to the renv.lock file.
To set up the project, create a new RStudio project in this directory, then launch the project from the .Rproj file or through the RStudio interface (File > Open Project > [project-name].Rproj). [project-name] is based on the project name chosen by user.
Upon opening the project, renv will automatically try to activate. You may receive the message:
* The project library is out of sync with the lockfile.
* Use `renv::restore()` to install packages recorded in the lockfile.
In this case, run the renv::restore() command in console to install the required packages to the renv project library. renv::restore() restores library dependencies from the lock file and installs them in the current environment
Other useful renv commands:
- The
renv::init()function can be ran to initialise the renv package allowing for a snapshot of the current dependancies to be stored. renv::snapshot()updates the lockfile with the current packages and versions from current environment.- The
renv::install()function allows for missing packages from the lockfile to be installed. renv::status()reports current status of packages including inconsistencies
Further details around the use of renv can be found here.
Command to request the whomap package from source if doesn't correctly pull from Renv:
remotes::install_github('glaziou/whomap')
The project is deployed on WHO's shinyapps.io account:
-
test: https://worldhealthorg.shinyapps.io/glass-dashboard-draft/
-
production: https://worldhealthorg.shinyapps.io/glass-dashboard/
With the PDFs the bundle size may need to be adjusted to assure that the deployment can be completed correctly.
Command to adjust bundle size for shinyapps.io (in bytes). Example doubles size to assure that bundle will fit in.
r options(rsconnect.max.bundle.size=2000000000) #check value has been updated with getOption('rsconnect.max.bundle.size')
The GLASS dashboard is recommended to be deployed on the largest available instance size (xxxlarge) to minimise load times. If needed, the instance size for a deployed Shinyapps.io application can be adjusted in the Shinyapps.io console, or in code using:
rsconnect::configureApp(project_name, size="xxxlarge") #size can be any value in c("small", "medium", "large", "xlarge", "xxlarge", "xxxlarge")
Note: this is only required once, and requires that the application has been published already
Deployment:
- Adjust bundle size option for Shinyapps.io using
options(rsconnect.max.bundle.size=2000000000) - Through the RStudio IDE the publish option is displayed in the top right corner of the code pane
- Requires connecting up RSconnect account
- Deployment name will be set as 'glass-dashboard-draft' for test deployment and 'glass-dashboard' for production
- Run
renv::status()to check packages are correctly installed - Local deployment can be achieved through running the application in RStudio IDE
- Alternatively run
shiny::runApp()in your R console.
To update data for AMU, place the new data in the 'data/AMU' folder and replace the previous data that is being overwritten. If the new file name does not match the previous one, either rename the file to match, or rename the parameter name for reading the CSV in the global.R file ('AMU data loading' section).
All data for Global AMR and CTA AMR is now retrieved via the XMART data API - any changes to the data should be automatically reflected in the dashboard. The data for each AMR section is retrieved using API queries in the relevant modules.
- For Global AMR, data is retrieved from the
RELAY_GLASS_AMRtable. - For AMR CTA profiles, data is retrieved from the
RELAY_GLASS_AMR_CTAtable.