This repository contains scripts for the charts in a trade analysis report of Kazakhstan for the Asian Development Bank. Each chart is a triplet of files sharing a common file name: the chart itself, saved as a PDF in the folder figures; a CSV file containing its underlying data, saved in data/final; and an R script that produces the two, saved in codes.
Each R script is organized into three sections.
- Setup. The needed R libraries are loaded and key parameters are defined.
- Data. The raw data is loaded and processed to extract the information needed for the chart. This is saved as a CSV file.
- Plot. The CSV file is loaded and (if necessary) wrangled further. The data is then plotted using the
ggplot2
library.
The Data section draws from: (1) the outputs of my other repos adb-mrio and baci, (2) the outputs of the Python scripts in the codes folder, and (3) other publicly available datasets. The last are uploaded in data/raw.
In principle, everything needed to replicate a chart is found in its CSV file, which means the Data section of the script can be skipped entirely.
This repository has no official affiliation with or approval from the Asian Development Bank.