The Data

The data this week comes from Harvard’s Dataverse by way of Mine Çetinkaya-Rundel, David Robinson, and Nicholas Goguen-Compagnoni.

Original Data citation:
> Citation: Erik Voeten “Data and Analyses of Voting in the UN General Assembly” Routledge Handbook of International Organization, edited by Bob Reinalda (published May 27, 2013). Available at SSRN: http://ssrn.com/abstract=2111149

unvotes <- read_csv("unvotes.csv")
roll_calls <- read_csv("roll_calls.csv")
issues <- read_csv("issues.csv")
issues %>%
  select(issue, short_name) %>%
  table()
##                                       short_name
## issue                                    co   di   ec   hr   me   nu
##   Arms control and disarmament            0 1092    0    0    0    0
##   Colonialism                           957    0    0    0    0    0
##   Economic development                    0    0  765    0    0    0
##   Human rights                            0    0    0 1015    0    0
##   Nuclear weapons and nuclear material    0    0    0    0    0  855
##   Palestinian conflict                    0    0    0    0 1061    0
vote_issues <- unvotes %>%
  full_join(issues, by = "rcid") %>%
  full_join(roll_calls, by = "rcid")

Voting patterns by date

vote_issues %>%
  filter(country %in% c("China","United States", "Canada", "Taiwan", "India")) %>%
  mutate(year = year(date)) %>%
  filter(!is.na(issue)) %>%
  filter(year >= 1980) %>%
  group_by(year, country, short_name) %>%
  mutate(propyes = mean(vote == "yes"), propno = mean(vote == "no")) %>%
  ggplot(aes(x = year, y = propyes, color = country)) + 
  geom_point() + 
  geom_line() +
  facet_wrap(~issue)

library(viridis)
vote_issues %>%
  filter(country %in% c("China","United States", "Canada", "Taiwan", "India")) %>%
  #mutate(country = ifelse(country == "Taiwan", "China", country)) %>%
  mutate(year = year(date)) %>%
  filter(!is.na(issue)) %>%
  #filter(year >= 1980) %>%
  group_by(year, country, short_name) %>%
  ggplot(aes(y = country, x = year, color = vote)) + 
  geom_jitter(height = .1) +
  scale_color_viridis(discrete = TRUE) +
  facet_wrap(~issue)

vote_issues %>%
  filter(country %in% c("China","United States", "Canada", "Taiwan", "India")) %>%
  mutate(year = year(date)) %>%
  filter(!is.na(issue)) %>%
  filter(year >= 1980) %>%
  filter(country == "United States") %>%
  #filter(short_name == "me") %>%
  ggplot(aes(x = year, fill = vote)) + 
  geom_area(stat = "bin", position = "fill") +
  scale_fill_viridis(discrete = TRUE) + 
  ylab("percentage") + 
  facet_wrap(~issue)

praise()
## [1] "You are grand!"