
Therefore, we first scrape an HTML table of country names, ISO3, ISO2 and UN codes for all countries worldwide. As different data sets have different formats for country names (e.g., “United Kingdom of Great Britain and Northern Ireland” versus “United Kingdom”), we’ll match country names to ISO3 codes to easily merge all data sets later on.

As we’ll make world maps, we need a way to map our data sets to geographical data containing coordinates (longitude and latitude). Now, we can continue with loading our data. Importing, exploring and cleaning the data Let’s first load the required packages into RStudio. We’ll start by loading and cleaning the data, whereafter we will build our interactive world maps in R Shiny. The data sources here are about childlessness and gender inequality, which is the focus of my PhD research, in which I computationally analyse the effects of gender and parental status on socio-economic inequalities. To show you how to adapt the interface of the app to the choices of the users, we’ll make use of two data sources such that the user can choose what data they want to explore, and that the app adapts the possible input choices to the users’ previous choices. As the Shiny app cannot be embedded into this blog, I will direct you to the live app and show you in this post on my GitHub how to embed a Shiny app in your R Markdown files, which is a really cool and innovative way of preparing interactive documents. In this post, I will show you how to create interactive world maps and how to show these in the form of an R Shiny app. She applies her interdisciplinary knowledge to computationally address societal problems of inequality.


With a passion for data science and a background in mathematics and econometrics. Florianne Verkroost is a PhD candidate at Nuffield College at the University of Oxford.
