Determines the dominant country in each PRIO-GRID cell using CShapes 2.0 boundary data and assigns the corresponding Gleditsch-Ward country code. For cells containing multiple countries, the country with the largest area coverage is assigned, with ties broken by selecting the lowest country code.
Usage
cshapes_gwcode(measurement_date, cshp = read_cshapes())Arguments
- measurement_date
A single
Dateobject specifying the date for country assignment. Must be within the temporal range of the CShapes dataset.- cshp
An
sfobject containing CShapes 2.0 boundary data with Gleditsch-Ward country codes. Defaults toread_cshapes()if not provided.
Note
Small countries or territories may not appear if they don't dominate any grid cells
The function includes an assertion check to verify all countries are represented
Future versions may include provisions for minority country representation
References
Schvitz G, Girardin L, Rüegger S, Weidmann NB, Cederman L, Gleditsch KS (2022). “Mapping the International System, 1886-2019: The CShapes 2.0 Dataset.” Journal of Conflict Resolution, 66(1), 144–161. ISSN 0022-0027, doi:10.1177/00220027211013563 , 2024-11-22.