Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
## Load libraries
library(tidyverse)
library(broom)
# library(RColorBrewer)
## Load data
# Educational Inequality Gini Coefficient (after age 15)
education_inequality <- read.csv("../data/EducationalInequalityGiniCoefficient.csv")
education_inequality$variable <- "education_inequality"
# GDP per Capita
gdp_per_capita <- read.csv("../data/GDPperCapita.csv")
gdp_per_capita$variable <- "gdp_per_capita"
# Gender Equality Years of Education (after age 15)
gender_equality_education <- read.csv("../data/GenderEqualityYearsofEducation.csv")
gender_equality_education$variable <- "gender_equality_education"
# Historical Gender Equality Index
gender_equality_index <- read.csv("../data/HistoricalGenderEqualityIndex_Compact.csv")
gender_equality_index$variable <- "gender_equality_index"
# Gender Equality of Numeracy
gender_equality_numeracy <- read.csv("../data/GenderEqualityofNumeracy_Compact.csv")
gender_equality_numeracy$variable <- "gender_equality_numeracy"
# Income Inequality
income_inequality <- read.csv("../data/IncomeInequality.csv")
income_inequality$variable <- "income_inequality"
# Sex Ratio (ages 0 - 5)
sex_ratio <- read.csv("../data/SexRatio_Compact.csv")
sex_ratio$variable <- "sex_ratio"
# Total Population
total_population <- read.csv("../data/TotalPopulation_Compact.csv")
total_population$variable <- "total_population"
total_population$value <- scale(total_population$value) # Scale the large range
# Average Years of Education (after age 15)
years_of_education <- read.csv("../data/AverageYearsofEducation.csv")
years_of_education$variable <- "education_years"
## Create different dataframe
data_long <- rbind(gdp_per_capita, education_inequality, gender_equality_education,
gender_equality_index, gender_equality_numeracy, income_inequality,
sex_ratio, total_population, years_of_education)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment