Disagapp is an application written in R that can be used to perform disaggregation regression analyses using {disaggregation} as described in Nandi et al. (2023). A version is deployed to https://disagapp.le.ac.uk/
Disagapp was built using the {shinyscholar} template which was itself forked from {wallace} v2.0.5 (CRAN, website)
Install disagapp via Github and run the application with the following R code.
install.packages("devtools")
devtools::install_github("simon-smart88/disagapp")
library(disagapp)
run_disagapp()We are organising a workshop to introduce Disagapp that will be held on Teams from 14:00-16:00 UTC on 16 September 2025. To sign up, please fill in the form at https://forms.office.com/e/pjfbD6RvTi
The application is divided into components that are steps in the analysis and modules that are possible options in each step of the analysis. Each of the modules calls a function of the same name, either in this package or in {disaggregation}.
- Combine spreadsheet and shapefile: upload both files and merge them
- Upload spreadsheet: upload the data and combine it with boundary data
- Upload shapefile: when the data is already merged in a shapefile
- Example datasets: load an example dataset
- Edit data: remove unwanted parts of the data
- Simplify polygons: simplify the geometries of the boundary data
- Accessibility: The time required to travel to cities or healthcare. Provided by the Malaria Atlas Project via
{malariaAtlas} - Climate: Various bioclimatic variables relating to temperature and precipitation. Provided by Worldclim via
{geodata} - Land use: The percentage of land covered by different classes of land use. Provided by the Copernicus programme via Zenodo.
- Nighttime lights: Satellite imagery of the intensity of nighttime lights. Provided by NASA via Worldpop
- Distance to water: The distance to surface water. Provided by Worldpop using data from ESA
- Population density: Population density provided by Worldpop
- Upload covariates: Upload your own covariates in the
.tifformat
- Population count: Population counts provided by Worldpop
- Land use: The percentage of land covered by different classes of land use. Provided by the Copernicus programme via Zenodo.
- Upload aggregation: Upload your own aggregation raster in the
.tifformat - Uniform: Generate a uniform aggregation raster
- Generate mesh: generate a spatial mesh from the response data
- Summarise and resample covariates: resample covariates so that they have the same resolution and extent
- Scale covariates: scales the covariates so that their coefficients can be compared fairly
- Covariate correlations: examine correlations between covariates
- Reduce covariate resolution: generate lower resolution covariates to speed up model fitting
- Finalise data preparation: combine all the data together
- Fit model: using either gaussian, binomial or poisson likelihood functions and logit, log or identity link functions
- Make predictions: generate predictions from the model
- Transfer predictions: transfer predictions to a new area of interest
- Reproduce environment: use
{renv}to capture dependencies, allowing the analysis to be reproduced exactly - Download covariates: download copies of the covariate data
- Download session code: download a
.Rmdfile that completely replicates the analysis - Download package references: download a list of all the packages used in the analysis
To add new modules, see the instructions in adding_modules.md
To update deployments running on shinyserver it is necessary to update the package and also copy the contents of /inst into the /apps directory.
R -e "remotes::install_github('simon-smart88/disagapp')"Because the repository contains the package files as well as the app, we need to update the local copy of the package and then update the app files.
cd /local/disagapp
git pull
cp -rf inst/shiny/. /local/shiny/apps/disagappsudo systemctl restart shiny-server
