Introduction: The UN-African Union Mission in
Darfur (UNAMID) opened in 2008 after the 2003-2004 genocide in Darfur,
Sudan. As seen in the following visual, at the mission’s height over
12,500 troops were stationed in Darfur. The mission officially ended at
the end of 2020. While attacks on civilians recorded by the ACLED
dataset are displayed below until the end of 2021, UNAMID troop numbers
from the Geo-PKO dataset are only published until the end of 2020, even
though the last troops left Darfur on June 30, 2021 in accordance with
UN
Security Council resolution 2559 (2020).
# Note: All code, insights shared, and methodological notes in this document and other documents in this portfolio ARE NOT open source and MUST be cited.
library(tidyverse)
library(ggplot2)
library(ggthemes)
library(ggpubr)
library(gridExtra)
setwd("C:/Users/rsb84/Desktop/RB/COLUMBIA/QMSS/COURSES/Spring_2021/Data Visualization/End_project")
ACLED_data <- readxl::read_excel("ACLED-DARFUR-VAC-2008-2021 (After Course Ended-for 2023 Portfolio)-UPDATED VERSION-inter1_numbers_replaced_with_actor_names.xlsx",
col_types = c("date", "numeric", "text",
"text", "text", "text", "text", "text",
"text", "text", "text", "text", "text",
"numeric", "numeric", "text", "text",
"text", "numeric", "numeric"))
geo_pko <- readxl::read_excel("geo_pko.xlsx")
troops_by_date_location = geo_pko %>% group_by(year, month, location) %>% tally(no.troops)
troops_by_date = geo_pko %>% group_by(year, month) %>% tally(no.troops)
troops_by_year = troops_by_date %>% group_by(year) %>% summarise(n = mean(n))
troops_by_year$n = round(troops_by_year$n, digits=0)
attacks_by_year=ACLED_data %>% group_by(year) %>% tally(attacks)
attacks_by_year=attacks_by_year %>% rename(attacks = n)
troops_by_year=troops_by_year %>% rename(avg_troops = n)
troops_by_year$year = as.character(troops_by_year$year)
attacks_by_year$year = as.character(attacks_by_year$year)
troops_and_attacks_by_year=full_join(troops_by_year, attacks_by_year, by="year")
a1 <- ggplot(troops_and_attacks_by_year, aes(x=as.numeric(year), y=avg_troops)) + geom_line(lwd=1.6, aes(color = avg_troops, size=3), color="steelblue") + scale_x_continuous("Year", breaks=0:2100) + scale_y_continuous("Average Number of Troops") + theme_wsj() + theme(title =element_text(size=18, color= "steelblue", face='bold'), axis.title.x=element_blank(), axis.title.y=element_blank(), axis.text.x = element_text(size = 9.7), axis.text.y = element_text(size = 12), legend.position="none", plot.caption = element_text(color = "steelblue", face = "bold", size=14)) + geom_vline(xintercept=as.integer(2011), color = "black", linetype="dashed", size = 1.2) + geom_vline(xintercept=as.integer(2015), color = "black", linetype="dashed", size = 1.2) + geom_vline(xintercept=as.integer(2020), color = "black", linetype="dashed", size = 1.2) + labs(title="Average Number of Troops in UNAMID, by Year", caption="")
a2 <- ggplot(troops_and_attacks_by_year, aes(x=as.numeric(year), y=attacks)) + geom_line(lwd=1.6, aes(color = attacks, size=3), color="red") + scale_x_continuous("Year", breaks=0:2100) + scale_y_continuous("Number of Attacks on Civilians") + theme_wsj() + theme(title =element_text(size=18, color= "steelblue", face='bold'), axis.title.x=element_blank(), axis.title.y=element_blank(), axis.text.x = element_text(size = 9.7), axis.text.y = element_text(size = 12), legend.position="none", plot.caption = element_text(color = "steelblue", face = "bold", size=14)) + geom_vline(xintercept=as.integer(2011), color = "black", linetype="dashed", size = 1.2) + geom_vline(xintercept=as.integer(2015), color = "black", linetype="dashed", size = 1.2) +
geom_vline(xintercept=as.integer(2020), color = "black", linetype="dashed", size = 1.2) + labs(title="Number of Attacks on Darfur Civilians during UNAMID, by Year", caption="Sources: 1. Geo-PKO Dataset, v2.1, Uppsala University, 2. The ACLED Dataset")
visual_1 <- ggarrange(a1, a2, nrow=2, ncol=1, align = "v")
visual_1