Practical Worksheet
Package and Data Loading
As mentioned within the session setup, load the following packages using the library()
function. Additionally, as we will be using a data set with large numbers, set scipen to 999 using the option function.
library(tidyverse)
library(RColorBrewer)
library(ggpubr)
options(scipen = 999)
Furthermore, for the purpose of this session, we will be using data from the World Bank Open Data. In particular we will be using a collection of variables from 1999, these variables were selected to provide us plenty of room to explore!
It is included in your downloaded zip file from the accompanying Github Repo and can be loaded using the following code:
WDB_1999 <- read_csv("data/WDB_1999.csv")
It includes the following variables:
- Country Name (Country Name)
- Country Code (Country Code)
- Continent (Continent)
- Year (Year)
- Population (Pop)
- Female Population (Pop.fe)
- Male Population (Pop.ma)
- Birth Rate, crude per 1000 people (birthrate)
- Death Rate, crude per 1000 people (deathrate)
- Life Expectancy at Birth in years (lifeexp)
- Female Life Expectancy at Birth in years (lifeexp.fe)
- Male Life Expectancy at Birth in years (lifeexp.ma)
- Educational Spending, percentage of GDP (ed.spend)
- Compulsory Education Duration in Years (ed.years)
- Labour Force Total (labour)
- Literature Rate in adults, percentage % (lit.rate.per)
- CO2 Emissions, kt (co2)
- Gross Domestic product, $ (gdp)
- Unemployment, percentage of total labour force (unemp)
- Female Unemployment, percentage of total labour force (unemp.fe)
- Male Unemployment, percentage of total labour force (unemp.ma)
- Health Expenditure per capita, $ (health.exp)
- Hospital Beds per 1000 people (medbeds)
- Number of Surgical Procedures per 1000 people (surg.pro)
- Number of Nurses & Midwives per 1000 people (nurse.midwi)