{"id":13665976,"url":"https://github.com/dgrtwo/unvotes","last_synced_at":"2025-03-16T07:32:28.745Z","repository":{"id":54116407,"uuid":"62845509","full_name":"dgrtwo/unvotes","owner":"dgrtwo","description":"United Nations General Assembly Voting Data","archived":false,"fork":false,"pushed_at":"2021-03-09T05:00:33.000Z","size":13415,"stargazers_count":58,"open_issues_count":0,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2023-11-28T07:51:15.558Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgrtwo.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-07T23:59:53.000Z","updated_at":"2023-11-19T00:58:12.000Z","dependencies_parsed_at":"2022-08-13T07:00:28.977Z","dependency_job_id":null,"html_url":"https://github.com/dgrtwo/unvotes","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrtwo%2Funvotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrtwo%2Funvotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrtwo%2Funvotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrtwo%2Funvotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgrtwo","download_url":"https://codeload.github.com/dgrtwo/unvotes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806050,"owners_count":20350775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T06:00:55.037Z","updated_at":"2025-03-16T07:32:27.846Z","avatar_url":"https://github.com/dgrtwo.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"tools/README-\",\n  cache.path = \"README-cache/\",\n  cache = TRUE,\n  message = FALSE\n)\n```\n\n## United Nations General Assembly Voting Data\n\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/unvotes)](https://cran.r-project.org/package=unvotes)\n[![Travis-CI Build Status](https://travis-ci.org/dgrtwo/unvotes.svg?branch=master)](https://travis-ci.org/dgrtwo/unvotes)\n\nThis package provides the voting history of countries in the [United Nations General Assembly](http://www.un.org/en/ga/), along with information such as date, description, and topics for each vote.\n\nThese come from the dataset [found here](https://dataverse.harvard.edu/dataset.xhtml?persistentId=hdl:1902.1/12379):\n\n\u003e 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)\n\nThis raw data, and the processing script, can be found in the [data-raw](data-raw) folder.\n\n### Installation\n\nInstall the package with:\n\n```{r eval = FALSE}\ninstall.packages(\"unvotes\")\n```\n\nYou can also install the development version of the package using [devtools](https://github.com/hadley/devtools):\n\n```{r eval = FALSE}\ndevtools::install_github(\"dgrtwo/unvotes\")\n```\n\n### Datasets\n\nThe package contains three datasets. First is the history of each country's vote. These are represented in the `un_votes` dataset, with one row for each country/vote pair:\n\n```{r}\nlibrary(dplyr)\nlibrary(unvotes)\n\nun_votes\n```\n\nThe package also contains a dataset of information about each roll call vote, including the date, description, and relevant resolution that was voted on:\n\n```{r}\nun_roll_calls\n```\n\nFinally, the `un_roll_call_issues` dataset shows relationships betwen each vote and 6 issues:\n\n```{r}\nun_roll_call_issues\n\ncount(un_roll_call_issues, issue, sort = TRUE)\n```\n\n(Use `help()` to get information and documentation about each dataset).\n\n### Example analysis\n\nMany useful analyses will first involve joining the vote and roll call datasets by the shared `rcid` (roll call ID) column:\n\n```{r joined}\nlibrary(dplyr)\n\njoined \u003c- un_votes %\u003e%\n  inner_join(un_roll_calls, by = \"rcid\")\n\njoined\n```\n\nOne could then count how often each country votes \"yes\" on a resolution in each year:\n\n```{r by_country_year, dependson = \"joined\"}\nlibrary(lubridate)\n\nby_country_year \u003c- joined %\u003e%\n  group_by(year = year(date), country) %\u003e%\n  summarize(votes = n(),\n            percent_yes = mean(vote == \"yes\"))\n\nby_country_year\n```\n\nAfter which this can be visualized for one or more countries:\n\n```{r by_country_year_plot, dependson = \"by_country_year\"}\nlibrary(ggplot2)\ntheme_set(theme_bw())\n\ncountries \u003c- c(\"United States of America\", \"India\", \"France\")\n\n# there were fewer votes in 2013\nby_country_year %\u003e%\n  filter(country %in% countries, year \u003c= 2013) %\u003e%\n  ggplot(aes(year, percent_yes, color = country)) +\n  geom_line() +\n  ylab(\"% of votes that are 'Yes'\")\n```\n\nSimilarly, we could look at how the voting record of the United States has changed on each of the issues by joining with the `un_roll_call_issues` dataset:\n\n```{r issue_plot, dependson = \"joined\", fig.height = 6, fig.width = 6}\njoined %\u003e%\n  filter(country == \"United States of America\") %\u003e%\n  inner_join(un_roll_call_issues, by = \"rcid\") %\u003e%\n  group_by(year = year(date), issue) %\u003e%\n  summarize(votes = n(),\n            percent_yes = mean(vote == \"yes\")) %\u003e%\n  filter(votes \u003e 5) %\u003e%\n  ggplot(aes(year, percent_yes)) +\n  geom_point() +\n  geom_smooth(se = FALSE) +\n  facet_wrap(~ issue)\n```\n\n### Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgrtwo%2Funvotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgrtwo%2Funvotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgrtwo%2Funvotes/lists"}