Let’s use some of the skills we put into practice to examine the subnational relationship between development and conflict in Nigeria.

In this breakout, we’ll:

  • Overlay different shape files to build a sub-national map of Nigeria.
  • Map conflict locations onto grid cell locations.
  • Generate a subnational choropleth map of conflict intensity.
  • Correlate conflict intensity with nightlight intensity (a proxy for sub-national economic development).


We’ll use the following spatial datasets for this project:

  • ACLED Conflict Event Data for location data on events related to instability.
    • About the data: ACLED is a “disaggregated data collection, analysis, and crisis mapping project. ACLED collects the dates, actors, locations, fatalities, and modalities of all reported political violence and protest events across Africa, South Asia, Southeast Asia, the Middle East, Central Asia and the Caucasus, Latin America and the Caribbean, and Southeastern and Eastern Europe and the Balkans.” For this exercise, we’ll focus just on the data pertaining to Africa. For more information regarding these data, please consult the ACLED methodology.
  • Prio-Grid data pertaining to African states.
    • About the data: The PRIO-GRID dataset is a grid structure that aids the compilation, management and analysis of spatial data within a time-consistent framework. It consists of quadratic grid cells that jointly cover all terrestrial areas of the world. Each grid cell contains cell-specific information on armed conflicts, socio-economic conditions, ethnic groups, physical attributes, climatic conditions and more.
    • Added to the grid shape file is information on nighttime lights, which captures the level of light pollution within a prio-grid unit. Values represent the gridcell average of the cloud-free composites made using all the available archived DMSP-OLS smooth resolution data for 1992 - 2012 calendar years.
  • Country shape file of Nigeria.

The data can be downloaded from the following Dropbox data transfer link.

# Load relevant packages


(1) Import and Prepare the Data

Read in the Nigeria country shape file, prio grid shape file, and the acled conflict (.csv) data.

In addition, do the following:

  • Subset the acled data so that we only consider events that occurred in Nigeria. Also, only consider events where the geo-precision code (geo_precision) equals 1 (that is, events where we are confident about where the location of the event took place).
  • Convert the location information (longitude and latitude) for the Nigeria Acled data into a simple features geometry.
# Import the data 

# Map of Nigeria
nig <- read_sf("Lectures/week_07/breakout/data/nigeria_shapefile/nigeria.shp")

# PRIO-Grid of Africa 
afr <-  read_sf("Lectures/week_07/breakout/data/africa_grid/africa_grid.shp")

# Conflict Data
acled <- read_csv("Lectures/week_07/breakout/data/acled_africa.csv")
Parsed with column specification:
  .default = col_character(),
  data_id = col_double(),
  iso = col_double(),
  event_id_no_cnty = col_double(),
  year = col_double(),
  time_precision = col_double(),
  inter1 = col_double(),
  inter2 = col_double(),
  interaction = col_double(),
  latitude = col_double(),
  longitude = col_double(),
  geo_precision = col_double(),
  fatalities = col_double(),
  timestamp = col_double()
See spec(...) for full column specifications.
# Only care about nigeria 
acled_nig <- acled %>% 
  filter(country=="Nigeria") %>% 
  filter(geo_precision == 1) %>% 

(2) Visual Check

Plot the three spatial data objects as separate plots. Combine the three separate plots into a single plot using patchwork.

# Generate the plot of Nigeria
plot_nig <- ggplot(nig) + geom_sf() + theme_map()

# Generate the plot of the prio grid data
plot_grid <- ggplot(afr) + geom_sf() + theme_map()

# Generate a plot of the acled-nigeria events
plot_conflict <- ggplot(acled_nig) + geom_sf(alpha=.1) + theme_map()

# Use patchwork to bring all three plots together
plot_nig + plot_grid + plot_conflict + plot_layout(ncol=1)