How to download OECD datasets in R
Packages we will need: In this blog post, we are going to look at downloading data from the OECD statsitics and data website. The Organisation for Economic Co-operation and Development (OECD) provides analysis, and policy recommendations for 38 industrialised countries. The 38 countries in the OECD are: We can download the OCED data package directly…
Top R packages for downloading political science and economics datasets
1. WDI The World Development Indicators (WDI) package by Vincent Arel-Bundock provides access to a database of hundreds of economic development indicators from the World Bank. Examples of variables include population, GDP, education, health, and poverty, school attendance rates.ee Reference: Arel-Bundock, V. (2017). WDI: World Development Indicators (R Package Version 2.7.1). 2. peacesciencer This package…
Create infographics with the Irish leader dataset in R and Canva
Click here to download the Irish leader datatset. This file details information on all Taoisigh since 1922. Source: Wikipedia Tentative Codebook Variable NameVariable DescriptionnoTaoiseach numbernameNamepartyPolitical partyconstituencyElectoral constituency bornDate of birthdiedDate of deathfirst_electedDate first entered the Dailentered_officeDate entering office of Taoiseachleft_officeDate leaving office of Taoiseachleft_dailDate left the Dailcum_daysTotal number of days in Dailcum_yearsTotal number of years…
How to create semi-circle parliament graphs with the ggparliament package in R
Packages we will need: Check out part 1 of this blog where you can follow along how to scrape the data that we will use in this blog. It will create a dataset of the current MPs in the Irish Dail. In this blog, we will use the ggparliament package, created by Zoe Meers. With…
Create a dataset of Irish parliament members
This blogpost will walk through how to scrape and clean up data for all the members of parliament in Ireland. Or we call them in Irish, TDs (or Teachtaí Dála) of the Dáil. We will start by scraping the Wikipedia pages with all the tables. These tables have information about the name, party and constituency…
Cleaning up messy World Bank data
Packages we will need: When you come across data from the World Bank, often it is messy. So this blog will go through how to make it more tidy and more manageable in R For this blog, we will look at World Bank data on financial aid. Specifically, we will be using values for net…
How to interpret linear models with the broom package in R
Packages you will need: This blog will look at the augment() function from the broom package. After we run a liner model, the augment() function gives us more information about how well our model can accurately preduct the model’s dependent variable. It also gives us lots of information about how does each observation impact the…
How to recreate Pew opinion graphs with ggplot2 in R
Packages we will need In this blog post, we are going to recreate Pew Opinion poll graphs. This is the plot we will try to recreate on gun control opinions of Americans: To do this, we will download the data from the Pew website by following the link below: We then select the variables related…
Examining Ireland’s foreign policy in pictures with R
Packages we will need: In January 2015, the Irish government published a review of Ireland’s foreign policy. The document, The Global Island: Ireland’s Foreign Policy for a Changing World offers a perspective on Ireland’s place in the world. In this blog, we will graph out some of the key features of Ireland’ foreign policy and so…
How to tidy up messy Wikipedia data with dplyr in R
Packages we will need: To see another blog post that focuses on cleaning messy strings and dates, click here to read We are going to look at Irish embassies and missions around the world. Where are the embassies, and which country has the most missions (including embassies, consulates and representational offices)? Let’s first scrape the…
Running tidy t-tests with the infer package in R
Packages we will need: For this t-test, we will compare US millenials and non-millenials and their views of the UK’s influence in the world. The data will come from Chicago Council Survey of American Public Opinion on U.S. Foreign Policy Click here to download 2017 policy survey data The survey investigates American public opinion on…
Check model assumptions with easystats package in R
Packages we will need: Easystats is a collection of R packages, which aims to provide a framework to tame the scary R statistics and their pesky models, according to their github repo. Click here to browse the github and here to go to the specific perfomance package CRAN PDF First run your regression. I will…
Comparing North and South Korean UN votes at the General Assembly with unvotes package
Packages we will use Last September 17th 2021 marked the 30th anniversary of the entry of North Korea and South Korea into full membership in the United Nations. Prior to this, they were only afforded observer status. keia.orgThe Two Koreas Mark 30 Years of UN Membership: The Road to Membership Let’s look at the types of…
Download and graph UN votes data with the unvotes package in R
Packages we will need: How to download UN votes to R. This package was created by David Robinson. Click here to read the CRAN PDF. We will download both the votes roll calls and the issues. Then we can use the inner_join() variable to add them together by the ID. We can create a year…
Grouping, counting words and making wordclouds
How to make wordclouds in R! First, download stop words (such as and, the, of) to filter out of the dataset Then we will will unnest tokens and count the occurences of each word in each decade. And with the kable() function we can make a HTML table that I copy and paste to this…
Wrangling and graphing UN Secretaries-General data with R
Packages we will need: According to Urquhart (1995) in his article, “Selecting the World’s CEO”, From the outset, the U.N. secretarygeneral has been an important part of theinstitution, not only as its chief executive,but as both symbol and guardian of theoriginal vision of the organization.There, however, specific agreement hasended. The United Nations, like anyimportant organization,…
Scraping and wrangling UN peacekeeping data with tidyr package in R
Packages we will need: For this blog post, we will look at UN peacekeeping missions and compare across regions. Despite the criticisms about some operations, the empirical record for UN peacekeeping records has been robust in the academic literature “In short, peacekeeping intervenes in the most difficultcases, dramatically increases the chances that peace willlast, and…
Convert event-level data to panel-level data with tidyr in R
Packages we will need: In this post, we are going to scrape NATO accession data from Wikipedia and turn it into panel data. This means turning a list of every NATO country and their accession date into a time-series, cross-sectional dataset with information about whether or not a country is a member of NATO in…
Lump groups together and create “other” category with forcats package
Packages we will need: For this blog, we are going to look at the titles of all countries’ heads of state, such as Kings, Presidents, Emirs, Chairman … understandably, there are many many many ways to title the leader of a country. First, we will download the PACL dataset from the democracyData package. Click here…
Visualise DemocracyData with graphs and maps
Packages we will need: In this post, we will look at easy ways to graph data from the democracyData package. The two datasets we will look at are the Anckar-Fredriksson dataset of political regimes and Freedom House Scores. Regarding democracies, Anckar and Fredriksson (2018) distinguish between republics and monarchies. Republics can be presidential, semi-presidential, or…