For testing
# Mozambique Malaria Dashboard.
**Geospatial Modelling for Malaria Evidence — Mozambique**
An R Shiny teaching dashboard for geospatial analysis of malaria burden across
Mozambique's 161 districts, built on routine surveillance data (2017–2024).
Modelled after the CEMA Geospatial Platform.
Live:
---
## Tech stack
### Runtime
| Layer | Package | Role |
|---|---|---|
| Framework | **shiny** | App server, reactive engine, module system |
| UI / theming | **bslib** | Bootstrap 5 theming (`bs_theme`), Google Fonts (Source Sans Pro) |
| Mapping | **leaflet** | Interactive choropleth maps of district polygons |
| Charts | **highcharter** | Time series, distributions, seasonality, scatter plots |
| Tables | **DT** | Interactive data tables with client-side export |
| Geospatial | **sf** | GeoJSON I/O, geometry handling, centroids |
| Spatial stats | **spdep** | Queen-contiguity neighbours, Moran's I, INLA adjacency graph |
| Data wrangling | **dplyr**, **tidyr** | Aggregation, joins, reshaping |
| I/O | **readr** | CSV loading |
| Formatting | **scales** | Axis/label number formatting |
| Utilities | **rlang**, **htmltools** | Tidy eval, HTML generation |
### Frontend assets
- **`www/styles.css`** — hand-written CSS (~20 KB); no build step, no bundler
- **MathJax 3.2.2** — loaded from CDN for the statistical notation in the lessons
- Vanilla JS scrollspy in `app.R` for the workbench anchor navigation
### Modelling
The **Areal SAE** tab presents a **BYM2** (Besag–York–Mollié 2) spatial model —
a Poisson likelihood with a reparameterised convolution prior splitting spatially
structured and unstructured random effects.
The model is **fitted offline with R-INLA**, not at
runtime. The app loads the precomputed result from `data/bym2_fit.rds`
(a list of `fit_summary_fixed`, a 161-row `df` of posterior quantities —
relative risks, credible intervals, CV, exceedance probabilities — and `cols`).
**INLA is therefore not required to run the app.** It is only needed to re- …