This repository is a replication package for the paper "News-Based Multidimensional Political Instability in West and Central Africa"
# Replication Package: News-Based Multidimensional Political Instability
## Overview
This repository is the formal replication package for the paper on news-based multidimensional political instability in West and Central Africa. The package contains the code, data, and manuscript-facing outputs required for the documented replication workflow.
The canonical entrypoints are:
- `Code/main.R` for the R workflow
- `Code/run_all.m` for the MATLAB workflow
## Folder Structure
```text
replication_package_news_based_multidimensional_political_instability/
├── README.md
├── LICENSE
├── Code/
│ ├── main.R
│ ├── run_all.m
│ ├── 1_read_data.R
│ ├── 2_data_preparation.R
│ ├── 3_benchmark_data.R
│ ├── functions.R
│ ├── helpers.R
│ ├── figure_code/
│ └── external/
├── Data/
│ ├── Raw/
│ │ ├── public/
│ │ └── restricted/
│ └── Derived/
└── Outputs/
├── Main/
│ ├── Figures/
│ └── Tables/
└── Annex/
├── Figures/
└── Tables/
```
## Requirements
- R version `4.5.2`
- Python version `3.14.4`
- MATLAB release `R2025a`
- R packages used in the scripts under `Code/`: `countrycode`, `dplyr`, `geomtextpath`, `ggplot2`, `ggpubr`, `haven`, `jsonlite`, `lubridate`, `purrr`, `readr`, `readxl`, `rnaturalearth`, `rnaturalearthdata`, `scales`, `sf`, `stringr`, `tidyr`, `tidyverse`, `xtable`, and `zoo`
These do not have to be installed by hand. `Code/main.R` loads the full list through `ensure_packages()` in `Code/helpers.R` and installs whatever is missing from CRAN; every individual script does the same for the subset it needs, so the scripts can also be run one at a time. To install nothing automatically, set the environment variable `NBS_INSTALL_MISSING=FALSE` before running — the scripts then stop with an error listing the packages to install manually.
- Sufficient local storage for the bundled raw inputs and derived files
Runtime:
Verified on `2026-05-04`: `Code/main.R` completed successfully in approximately 9 minutes on the local machine used for …