Skip to content

Instantly share code, notes, and snippets.

@ajstewartlang
Created May 21, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajstewartlang/e28eb7347476898533d3733e51f4233a to your computer and use it in GitHub Desktop.
Save ajstewartlang/e28eb7347476898533d3733e51f4233a to your computer and use it in GitHub Desktop.
Tidy_Tuesday_May_21_2019
library(tidyverse)
library(janitor)
library(countrycode)
library(ggthemes)
waste_vs_gdp <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-21/per-capita-plastic-waste-vs-gdp-per-capita.csv")
waste_vs_gdp <- clean_names(waste_vs_gdp)
waste_vs_gdp$continent <- countrycode(sourcevar = waste_vs_gdp$entity,
origin = "country.name",
destination = "continent")
options(scipen = 999)
waste_vs_gdp %>%
group_by(continent) %>%
filter(continent == "Europe" & !is.na(per_capita_plastic_waste_kilograms_per_person_per_day)) %>%
ggplot(aes(x = per_capita_plastic_waste_kilograms_per_person_per_day,
y = reorder(entity, per_capita_plastic_waste_kilograms_per_person_per_day))) +
geom_point(size = 4) +
labs(x = "Per Capita Plastic Waste, Kilos per Day",
y = "European Country",
title = "Per Capita Plastic Waste in Europe in 2010",
subtitle = "Per Capita Waste Kilograms per Day") +
theme_economist()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment