This page visualizes the voting behavior of Tanzania and all other UN member countries in the UN General Assembly in 2023. Scholars have used these data to track how close or apart countries are in international relations; for examples, see here https://goo.gl/fZPBUO and here https://goo.gl/vlzVFf.
This map below is shaded based on how similar or different countries’ voting record was to that of Tanzania. Countries with darker shading have a similar voting record to Tanzania; countries with brigher colors vote against Tanzania more often. You can zoom and pan the map. Hover of a country for more information. Lower values on the “Difference” score mean that a country has a more similar voting record to Tanzania.
library("tidyverse")
library("plotly")
# Load data, downloaded from https://dataverse.harvard.edu/dataset.xhtml?persistentId=hdl:1902.1/12379
dd <- rio::import("/Users/johanneskarreth/Library/Mobile Documents/com~apple~CloudDocs/Files/Uni/Teaching/POL 350 (Model UN)/Fall 2024/Handouts/IdealpointestimatesAll_Jun2024.csv")
dd23 <- filter(dd, session == 78)
dd23$TanDiff <- abs(dd23$IdealPoint - dd23[dd23$Countryname == "Tanzania", ]$IdealPoint)
# dd23$country_name <- countrycode::countrycode(sourcevar = dd23$ccode,
# origin = "cown",
# destination = "country.name")
# dd23[dd23$ccode == 816, ]$country_name <- "Vietnam"
library("ggthemes")
library("maps")
worldmap <- map_data("world")
worldmap$ccode <- as.numeric(countrycode::countrycode(sourcevar = worldmap$region, origin = "country.name", destination = "cown"))
worldmap[worldmap$region == "Vietnam", ]$ccode <- 816
tbs <- quantile(dd23$TanDiff, probs = c(0, 0.2, 0.4, 0.6, 0.8, 1))
dd23$TanDiff_quantiles <- cut(dd23$TanDiff, breaks = c(0.0000001, tbs), include.lowest = TRUE)
Tan_map <- left_join(x = worldmap,
y = dd23,
by = c("ccode" = "ccode"))
# dd23$countrycode_iso3c <- countrycode::countrycode(dd23$country_name,
# origin = "country.name",
# destination = "iso3c")
# manually add the code for Vietnam (VNM)
# dd23[dd23$ccode == 816, ]$countrycode_iso3c <- "VNM"
dd23 <- filter(dd23, !is.na(iso3c))
Tan_map$Country <- Tan_map$region
library("ggthemes")
library("viridis")
p2 <- ggplot(data = filter(Tan_map, region != "Antarctica"),
aes(x = long, y = lat, group = group, label = Country)) +
geom_polygon(aes(fill = TanDiff_quantiles)) +
coord_map("rectangular", lat0 = 0, ylim = c(-60, 80), xlim=c(-180,180)) +
scale_x_continuous(breaks = FALSE) +
scale_y_continuous(breaks = FALSE) +
# scale_fill_manual(values = (c("black", "green", viridis_pal(option = "C", direction = 1)(5)[1:4], "green", viridis_pal(option = "C", direction = 1)(5)[5])), na.value = "gray") +
# scale_fill_manual(values = (c(viridis_pal(option = "C", direction = 1)(6)[1:6])), na.value = "gray") +
scale_fill_manual(values = (c("green", viridis_pal(option = "C", direction = 1)(6)[1:6])), na.value = "gray") +
guides(fill = "none") +
theme_map() +
labs(title = "UNGA voting proximity to Tanzania (darker = more similar)",
subtitle = "Data for 2023 (UNGA 78).\nBrighter shading indicates higher distance from Tanzania's voting record.",
caption = "Source: Bailey et al. (2017)") +
theme(legend.position = "none")
ggplotly(p2, tooltip = c("label", "fill"))
The second figure shows each country’s voting record’s similarity to Tanzania’s in the 2022 (77th) session. Countries with the lowest values (to the left) voted with Tanzania the most; countries with the highest value voted with Tanzania the least often.
dd23$Continent <- countrycode::countrycode(sourcevar = dd23$ccode, origin = "cown", destination = "continent")
dd23$pctagreeTan <- abs(dd23$TanDiff)
dd23$pctagreeTan <- ifelse(dd23$Countryname == "Tanzania", 0, dd23$pctagreeTan)
p3 <- ggplot(data = arrange(filter(dd23, !is.na(Countryname) & !is.na(pctagreeTan) & !is.na(Continent)), pctagreeTan),
aes(x = pctagreeTan, y = reorder(Countryname, -pctagreeTan), color = Continent)) +
geom_point() +
geom_text(aes(x = ifelse(pctagreeTan > 1, pctagreeTan - 0.05, pctagreeTan + 0.05), hjust = ifelse(pctagreeTan > 1, 1, 0), label = Countryname), size = 2) +
scale_y_discrete(breaks = 0) +
# scale_color_viridis_d() +
ylab("") +
xlab("UNGA voting distance from Tanzania, 2023") +
labs(color = "", title = "UNGA voting distance from Tanzania",
subtitle = "All countries, 2023.\nHigher values mean fewer votes in agreement with Tanzania",
caption = "Source: Bailey et al. (2017)") +
theme_minimal() + theme(legend.position = c(0.75, 0.9))
# Print
p3
The data used in this visualization are taken from:
The figures were made in R, using the plotly package for interactive figures.