GAIA spatial ex-ante framework for soil acidity across sub-Saharan Africa
# GAIA-EXANTE-FRAMEWORK
This repository contains the **GAIA Ex-ante Framework**, a framework for data-driven, ex-ante analysis of soil
acidity across sub-saharan Afric and the broader implications of agricultural interventions, such as lime application and yield improvement strategies on crop yield responses to liming and profitability. The framework is structured into several scripts that collectively enable us to process data, model responses, conduct sensitivity analyses, and generate summaries and visualizations. For more information on the framework, please refer to the GAIA project website.
## Folder Structure
### 1. `data-input`
This folder contains raw input datasets required for analysis.
- **`before-you-start.txt`**: A quick guide outlining prerequisites, including include soil data, crop yield information, spatial layers, and related files.
### 2. `data-output`
This folder contains the outputs generated by the scripts, including cleaned datasets, analysis results, and visualizations.
### 3. `scripts-1-workflow`
Contains the main scripts for running the GAIA framework workflow. The workflow is sequential and follows logical steps for preparing data, modeling, and analysis.
- **`wow-0-install-packages.R`**: Installs all the required R packages to run the framework.
- **`wow-1-layers-soilgrids.R`**: Processes soil data layers from SoilGrids or similar sources.
- **`wow-2-layers-spam.R`**: Processes SPAM (Spatial Production Allocation Model) data layers for crop-specific details.
- **`wow-3-lime-requirements.R`**: Calculates lime requirements based on soil acidity and crop demands.
- **`wow-4-crop-parameters.R`**: Sets crop-specific parameters for yield modeling.
- **`wow-5-crop-yield-loss-function.R`**: Models crop yield loss due to limiting factors such as soil acidity.
- **`wow-6-crop-yield-response.R`**: Simulates crop yield responses to agricultural interventions, such as lime application.
- **`wow-7-profitability-function.R`**: Evaluates prof …