This repository houses a set of R scripts created to analyze and implement index insurance for coffee farmers in Colombia, using heat index data. Developed during a consultancy with the Inter-American Development Bank (IADB), this work aims to support risk management strategies for smallholder coffee growers. Last updated in 2016.
These scripts develop analytical methods to:
- Process and interpret temperature and climate data relevant to coffee-growing regions in Colombia
- Calculate heat-based index insurance parameters, such as threshold exceedance and payout triggers
- Visualize temporal patterns and risk levels via static or interactive plots
- Support data-informed insurance model design in agri-risk management
The goal: to help stakeholders design effective index-based insurance policies that respond to temperature-induced yield risks.
This project comprises:
scripts/: R scripts for data ingestion, heat index computation, threshold analysis, and visualizationdata/(optional): input files (e.g., weather station data, climate grids), if includedoutputs/(optional): generated charts, tables, summariesREADME.md: this introductory documentation
(Note: Directory names should match actual structure—adjust if needed.)
- R (≥ 3.2)
- Recommended packages:
tidyverse(for data manipulation and plotting)lubridate(for date/time processing)lubridateorzoo(for rolling window calculations)ggplot2(visualizations)sforsp(if spatial data handling is included)data.table(for efficient data processing)
Install within R:
install.packages(c("tidyverse", "lubridate", "ggplot2", "data.table", "sf"))