iFEED Zambia extremes nutrition analysis code

Read full text
Authors: Stewart Jennings, Richard Rigby, Jennifer MacDiarmid, Richard King, Andrew Juan Challinor
Cited by: 1

Abstract

The R code iFEED_TNT.R produces the nutrition security results presented in the publication "Adaptive policies balancing trade, productivity and cropland increases can support Zambia’s nutrition security under future climate shocks" https://www.nature.com/articles/s43016-026-01405-1. This code produces output files for all climate models and scenarios presented in the paper. The R code iFEED_land_use_allocation.R produces the food production results associated with each scenario and climate model, as used as input to iFEED_TNT.R (via glam_prod.csv). This code was developed and tested under the following conditions: Operating System: Linux (x86_64-pc-linux-gnu) System Libraries: GLIBC version 2.17 Environment Manager: Conda R Version: 4.5.2 The Conda environment installs the correct version of R (4.5.2) and all required libraries. INSTALLATION, SETUP AND CREATING OUTPUTS Prerequisites: You must have Miniconda or Anaconda installed. If you do not have it, you can download it at: https://docs.conda.io/en/latest/miniconda.html Create the Environment: The environment is defined in the "environment.yml" file. To create the environment, open your terminal/command prompt, navigate to this project folder, and run: conda env create -f environment.yml Activate the Environment: Always activate the environment before running any scripts: conda activate iFEED_Zambia Verification: To verify that the environment is set up correctly, run the following command: Rscript -e "library(writexl); library(codetools); print('Setup Successful')" 5. Running the scripts: Rscript iFEED_land_use_allocation.R Rscript iFEED_TNT.R 6. Outputs: The outputs of the paper can be found in the “paper_outputs” directory. After running the scripts, outputs will be saved in the “out” directory to compare.

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
24 February 2026