<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/an-east-west-less-divided/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://thinkr.biz/2018/05/19/east-west-division/"> R – thinkr</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>With tensions heightened recently at the United Nations, one might wonder whether we’ve drawn closer, or farther apart, over the decades since the UN was established in 1945.</p>
<p>We’ll see if we can garner a clue by performing cluster analysis on the General Assembly voting of <a rel="nofollow" href="http://www.un.org/depts/dhl/unms/founders.shtml" target="_blank">five of the founding members</a>. We’ll focus on the five permanent members of the Security Council. Then later on we can look at whether Security Council vetoes corroborate our findings.<span></span></p>
<p>A prior article, entitled the “<a rel="nofollow" href="https://thinkr.biz/2018/01/29/cluster-of-six/" target="_blank">cluster of six</a>“, employed unsupervised machine learning to discover the underlying structure of voting data. We’ll use related techniques here to explore the voting history of the <a rel="nofollow" href="http://www.un.org/en/ga/" target="_blank">General Assembly</a>, the only organ of the United Nations in which all 193 member states have equal representation.</p>
<p>By dividing the voting history into two equal parts, which we’ll label as the “early years” and the “later years”, we can assess how our five nations cluster in the two eras.</p>
<p><img sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" src="https://i0.wp.com/thinkr.biz/wp-content/uploads/2018/05/plot-eras-1.png?w=450&ssl=1" alt="" class="wp-image-784" data-recalc-dims="1"></p>
<p>During the early years, France, the UK and the US formed one cluster, whilst Russia stood apart.</p>
<p>Although the <a rel="nofollow" href="https://en.wikipedia.org/wiki/China_and_the_United_Nations" target="_blank">Republic of China (ROC) joined the UN at its founding in 1945,</a> it’s worth noting that the <a rel="nofollow" href="https://en.wikipedia.org/wiki/China_and_the_United_Nations#People%27s_Republic_of_China_in_the_UN_(1971%E2%80%93present)" target="_blank">People’s Republic of China (PRC), commonly called China today, was admitted into the UN in 1971</a>. Hence its greater distance in the clustering.</p>
<p>Through the later years, France and the UK remained close. Not surprising given our EU ties. Will Brexit have an impact going forward?</p>
<p>The US is slightly separated from its European allies, but what’s more striking, is the shorter distance between these three and China / Russia. Will globalization continue to bring us closer together, or is the tide about to turn?</p>
<p>The cluster analysis above focused on General Assembly voting. By web-scraping the <a rel="nofollow" href="http://research.un.org/en/docs/sc/quick/veto" target="_blank">UN’s Security Council Veto List</a>, we can acquire further insights on the voting patterns of our five nations.</p>
<p><img sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" src="https://i0.wp.com/thinkr.biz/wp-content/uploads/2018/05/vetoes-1.png?w=450&ssl=1" alt="" class="wp-image-785" data-recalc-dims="1"></p>
<p>Russia dominated the early vetoes before these dissipated in the late 60s. Vetoes picked up again in the 70s with the US dominating through to the 80s. China has been the most restrained throughout.</p>
<p>Since the 90s, there would appear to be less dividing us, supporting our finding from the General Assembly voting. But do the vetoes in 2017, and so far in 2018, suggest a turning of the tide? Or just a temporary divergence?</p>
<h2>R toolkit</h2>
<p>R packages and functions (excluding base) used throughout this analysis.</p>
<div>
<table>
<thead>
<tr>
<th> </th>
<th><strong>Packages</strong></th>
<th><strong>Functions</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="https://i1.wp.com/thinkr.biz/wp-content/uploads/2017/10/Program-e1509478672361.png?resize=100%2C100&ssl=1" alt="" width="100" class="wp-image-135" data-recalc-dims="1" height="100"></td>
<td>purrr</td>
<td>map_dbl[3]; map[1]; map2_df[1]; possibly[1]; set_names[1]</td>
</tr>
<tr>
<td><img src="https://i0.wp.com/thinkr.biz/wp-content/uploads/2017/10/Import-e1509478685299.png?resize=100%2C100&ssl=1" alt="" width="100" class="wp-image-134" data-recalc-dims="1" height="100"></td>
<td>XML</td>
<td>readHTMLTable[1]</td>
</tr>
<tr>
<td rowspan="8"><img src="https://i2.wp.com/thinkr.biz/wp-content/uploads/2017/10/Transform-e1509478657749.png?resize=100%2C100&ssl=1" alt="" width="100" class="wp-image-136" data-recalc-dims="1" height="100"></td>
<td>dplyr</td>
<td>if_else[15]; mutate[9]; filter[6]; select[5]; group_by[3]; summarize[3]; distinct[2]; inner_join[2]; slice[2]; arrange[1]; as_data_frame[1]; as_tibble[1]; data_frame[1]; desc[1]; rename[1]</td>
</tr>
<tr>
<td>tibble</td>
<td>as_data_frame[1]; as_tibble[1]; data_frame[1]; enframe[1]; rowid_to_column[1]</td>
</tr>
<tr>
<td>stringr</td>
<td>str_c[8]; str_detect[6]; str_replace[3]; fixed[2]; str_remove[2]; str_count[1]</td>
</tr>
<tr>
<td>rebus</td>
<td>dgt[1]; literal[1]; lookahead[1]; lookbehind[1]</td>
</tr>
<tr>
<td>lubridate</td>
<td>year[7]; dmy[1]; today[1]; ymd[1]</td>
</tr>
<tr>
<td>dummies</td>
<td>dummy.data.frame[2]</td>
</tr>
<tr>
<td>tidyr</td>
<td>spread[3]; gather[2]; unnest[1]</td>
</tr>
<tr>
<td>cluster</td>
<td>pam[3]</td>
</tr>
<tr>
<td rowspan="6"><img src="https://i1.wp.com/thinkr.biz/wp-content/uploads/2017/10/Visualize-e1509478640644.png?resize=100%2C100&ssl=1" alt="" width="100" class="wp-image-137" data-recalc-dims="1" height="100"></td>
<td>ggplot2</td>
<td>aes[6]; ggplot[5]; ggtitle[5]; scale_x_continuous[5]; element_blank[4]; geom_text[4]; geom_line[3]; geom_point[3]; ylim[3]; element_rect[2]; geom_col[2]; labs[2]; scale_fill_manual[2]; theme[2]; coord_flip[1]</td>
</tr>
<tr>
<td>factoextra</td>
<td>fviz_cluster[3]; fviz_dend[1]; fviz_silhouette[1]; hcut[1]</td>
</tr>
<tr>
<td>cowplot</td>
<td>draw_plot[2]; ggdraw[1]</td>
</tr>
<tr>
<td>ggthemes</td>
<td>theme_economist[1]</td>
</tr>
<tr>
<td>kableExtra</td>
<td>kable[1]; kable_styling[1]</td>
</tr>
<tr>
<td>knitr</td>
<td>kable[1]</td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>View the code <a rel="nofollow" href="https://thinkr.biz/wp-content/uploads/2018/05/unvotes.html" target="_blank">here</a>.</p>
<h3>Citations / Attributions</h3>
<p>R Development Core Team (2008). R: A language and environment for<br>
statistical computing. R Foundation for Statistical Computing,<br>
Vienna, Austria. ISBN 3-900051-07-0, URL <a rel="nofollow" href="http://www.r-project.org/" target="_blank">http://www.R-project.org</a>.</p>
<p>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)</p>
<p>The post <a rel="nofollow" href="https://thinkr.biz/2018/05/19/east-west-division/" target="_blank">An East-West less divided?</a> appeared first on <a rel="nofollow" href="https://thinkr.biz/" target="_blank">thinkr</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://thinkr.biz/2018/05/19/east-west-division/"> R – thinkr</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/Od8vL3Uwoa0" height="1"></a></div>