Setup
Get your environment ready before class — about 15–30 minutes
TipDo this before class
Installing R packages and KITE over conference Wi-Fi is the one thing guaranteed to go wrong. Run the steps below at home — total time ~15–30 min including package installation.
1 · System requirements
| Tool | Minimum | Note |
|---|---|---|
| R | 4.3+ | RStudio optional; we run scripts from the command line |
| GNU Make | any | macOS and Linux have it; Windows users can install via WSL or Rtools |
| git | 2.30+ | for cloning the repo |
| TeX Live | full | only needed to rebuild the slides locally |
On macOS: brew install r make git. On Debian/Ubuntu: sudo apt install r-base build-essential git.
2 · Clone the repo
git clone https://github.com/julianhinz/economics-of-sanctions.git
cd economics-of-sanctions3 · Install R and the packages
R ≥ 4.3, plus the packages below (they also install on first run via pacman::p_load(), but doing it now avoids the Wi-Fi gamble):
install.packages("pacman")
pacman::p_load(data.table, magrittr, stringr, fixest, ggplot2,
scales, arrow, countrycode, remotes, rnaturalearth, sf)
remotes::install_github("julianhinz/KITE", ref = "release/26.05", upgrade = "never")4 · Get the prepared data
- Exercise 2 (KITE) ships its initial conditions inside the repo —
exercises/02-kite-russia/input/initial_conditions/initial_conditions_ICIO_2022.rds. Nothing to download. - Exercise 1 (Colombia) needs the prepared customs bundle
colombian_trade.csv.gz. Download it fromcdn.jhi.nz/data/colombian_trade.csv.gzand drop it atexercises/01-colombia-venezuela/input/colombian_trade.csv.gz. (You can also regenerate it yourself by runningmakein that exercise, which scrapes the DANE catalog directly — slow, but credential-free.)
5 · Smoke test
cd exercises/01-colombia-venezuela && make estimate
cd ../02-kite-russia && make baselineIf both run without error, you are ready. See Session 2 and Session 3 for what each pipeline does.
6 · Troubleshooting
pacmaninstall fails — useinstall.packages("pacman", repos = "https://cloud.r-project.org").fixestis slow on the first run — it links to OpenMP; later runs are fast.- KITE fails to install — install
remotesandRcppfirst, then retry. - Out of memory — Exercise 2 uses ~6 GB at peak. Close other apps.