This page visualizes the voting behavior of Iraq and all other UN member countries in the UN General Assembly since 2005. 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 Iraq. Countries with darker shading have a similar voting record to Iraq; countries with brigher colors vote against Iraq 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 Iraq.

library("tidyverse")
library("plotly")

# Load data, downloaded from https://dataverse.harvard.edu/dataset.xhtml?persistentId=hdl:1902.1/12379
dd <- rio::import("/Users/johanneskarreth/Documents/Dropbox/Uni/Teaching/POL 350 (Model UN)/Spring 2019/Handouts/dataverse_files/Dyadicdata.RData")
dd_iraq <- filter(dd, ccode2 == 645 & year >= 2014)
dd_iraq <- summarize(group_by(dd_iraq, ccode1),
                        avg_agree3un = mean(agree3un, na.rm = TRUE),
                        avg_absidealdiff = mean(absidealdiff, na.rm = TRUE))

dd_iraq$country_name <- countrycode::countrycode(sourcevar = dd_iraq$ccode1,
                                               origin = "cown",
                                               destination = "country.name")

dd_iraq$Continent <- countrycode::countrycode(sourcevar = dd_iraq$ccode1,
                                               origin = "cown",
                                               destination = "continent")
library("ggthemes")
library("maps")

worldmap <- map_data("world")
dd_iraq_map <- tibble(ccode1 = 645,
                      avg_agree3un = 1,
                      avg_absidealdiff = 0,
                      country_name = "Iraq",
                      Continent = "Asia")
dd_iraq_map <- rbind(dd_iraq, dd_iraq_map)
dd_iraq_map$avg_absidealdiff_quantiles <- cut(dd_iraq_map$avg_absidealdiff, breaks = c(0, 0.001, 0.1, 0.2, 0.35, 0.5, 0.75, 1.75, 3.4), include.lowest = TRUE)
dd_iraq_map$Difference <- dd_iraq_map$avg_absidealdiff

# join UNGA and map data
iraq_map <- left_join(x = worldmap,
                      y = dd_iraq_map,
                      by = c("region" = "country_name"))
# glimpse(iraq_map)

# create a map as a first take

# ggplot(data = iraq_map,
#        aes(x = long, y = lat, group = group)) + 
#   geom_polygon(aes(fill = avg_agree3un))

# Note: some (important!) countries didn't match, so let's make sure all countries matched.

# use the countrycode package to generate universal country codes to match

dd_iraq_map$countrycode_iso3c <- countrycode::countrycode(dd_iraq_map$country_name,
                                                          origin = "country.name",
                                                          destination = "iso3c")

# manually add the code for Vietnam (VNM)
dd_iraq_map[dd_iraq_map$ccode1 == 816, ]$countrycode_iso3c <- "VNM"
dd_iraq_map <- filter(dd_iraq_map, !is.na(countrycode_iso3c))

# next, for the worldmap
worldmap$countrycode_iso3c <- countrycode::countrycode(worldmap$region,
                                                             origin = "country.name",
                                                             destination = "iso3c")

# join UNGA and map data
iraq_map <- left_join(x = worldmap,
                      y = dd_iraq_map,
                      by = c("countrycode_iso3c" = "countrycode_iso3c"))
iraq_map$Country <- iraq_map$country_name
levels(iraq_map$avg_absidealdiff_quantiles) <- c("[0]", "(0.001-0.1]", "(0.1-0.2]", "(0.2-0.35]", "(0.35-0.5]", 
"(0.5-0.75]", "(0.75-1.75]", "(1.75-3.4]")
iraq_map$Difference <- iraq_map$avg_absidealdiff_quantiles

# create a map as a second take

# ggplot(data = iraq_map,
#        aes(x = long, y = lat, group = group)) + 
#   geom_polygon(aes(fill = avg_absidealprox))

# This looks good, now finalize the map

library("ggthemes")
library("viridis")

p2 <- ggplot(data = filter(iraq_map, region != "Antarctica"),
       aes(x = long, y = lat, group = group, label = Country)) + 
  geom_polygon(aes(fill = Difference)) + 
  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_viridis_d(na.value = "gray", direction = -1) + 
  scale_fill_manual(values = (c("#000000", viridis_pal(option = "C", direction = 1)(7))), na.value = "gray") + 
  guides(fill = FALSE) + 
  theme_map() + 
  labs(title = "UNGA voting proximity to Iraq",
       subtitle = "Data for 2014-15.\nDarker shading indicates countries voting with Iraq more often.",
       caption = "Source: Bailey et al. (2017)") + 
  theme(legend.position = "none")

ggplotly(p2, tooltip = c("label", "fill"))

The second figure shows voting patterns over time. Here, higher values mean that a country’s votes were more similar to Iraq. This measure is based on UNGA votes from 2005-2015. You can identify other countries’ names by hovering over each line. Use the zoom and pan buttons on the top right to zoom into Iraq’s closest “friends” at the UN.

# Load data, downloaded from https://dataverse.harvard.edu/dataset.xhtml?persistentId=hdl:1902.1/12379
d <- rio::import("/Users/johanneskarreth/Documents/Dropbox/Uni/Teaching/POL 350 (Model UN)/Spring 2019/Handouts/dataverse_files/IdealpointsPublished.dta")

# Code Iraq identifier
d$Iraq <- ifelse(d$ccode == 645, 1, 0)

# Create region labels
d$region <- factor(d$unsc_region, levels = c(1:5), labels = names(attr(d$unsc_region, "labels")))

# Create absolute ideal point difference
Iraq <- select(filter(d, Iraq == 1), year, Idealpoint)
names(Iraq) <- c("year", "Iraq_Idealpoint")
d <- left_join(x = d, y = Iraq, by= "year")
d$absidealdist <- abs(d$Idealpoint - d$Iraq_Idealpoint)
d$absidealprox <- abs(d$Idealpoint - d$Iraq_Idealpoint) * (-1)

# Make plot
p <- ggplot(data = filter(d, Iraq == 0 & year >= 2005), aes(x = year, y = absidealdist, group = CountryName)) + 
  geom_line(alpha = 0.5, size = 0.25, aes(color = factor(region))) + 
  scale_colour_brewer(palette = "Set1") + 
  scale_x_continuous(breaks = c(2005, 2010, 2015)) +
  theme_minimal() +
  xlab("") + ylab("UNGA voting ideal point distance from Iraq") + 
  labs(color = "", title = "UNGA voting ideal point distance from Iraq",
       subtitle = "All countries, 2005-2015.\nLower values mean more similar votes to Iraq.",
       caption = "Ideal points measure states' preferences based on their votes on resolutions in the UN General Assembly.\nSource: Bailey et al. 2017.")

# Export plot to plotly
ggplotly(p)

The third figure shows each country’s voting record’s similarity to Iraq’s in the 2014-15 cycle. Countries with the highest values (to the right) voted with Iraq most often.

p3 <- ggplot(data = arrange(filter(dd_iraq, !is.na(country_name) & !is.na(avg_agree3un) & !is.na(Continent)), avg_agree3un), 
             aes(x = avg_agree3un, y = reorder(country_name, avg_agree3un), color = Continent)) + 
            geom_point() + 
            geom_text(aes(x = ifelse(avg_agree3un > 0.66, avg_agree3un - 0.01, avg_agree3un + 0.01), hjust = ifelse(avg_agree3un > 0.66, 1, 0), label = country_name), size = 2) + 
  scale_y_discrete(breaks = 0) + 
  # scale_color_viridis_d() + 
  ylab("") + 
  xlab("Share of UNGA votes in agreement with Iraq, 2014-15") + 
  labs(color = "", title = "UNGA votes in agreement with Iraq",
       subtitle = "All countries, 2014-15.\nHigher values mean more votes in agreement with Iraq.",
       caption = "Source: Bailey et al. 2017.") + 
  theme_minimal() + theme(legend.position = c(0.1, 0.9))

# Print
p3

Source

The data used in this visualization are taken from:

The figure was made in R, using the plotly package for interactive figures.