Skip to content

Instantly share code, notes, and snippets.

@ajstewartlang
Last active May 21, 2019 18:59
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/c957bf9cc051d05393ab452511c14556 to your computer and use it in GitHub Desktop.
Save ajstewartlang/c957bf9cc051d05393ab452511c14556 to your computer and use it in GitHub Desktop.
TidyTuesday_May21_2019
library(tidyverse)
library(janitor)
library(countrycode)
library(ggthemes)
coast_vs_waste <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-21/coastal-population-vs-mismanaged-plastic.csv")
coast_vs_waste <- clean_names(coast_vs_waste)
coast_vs_waste$continent <- countrycode(sourcevar = coast_vs_waste$entity,
origin = "country.name",
destination = "continent")
options(scipen = 999)
coast_vs_waste %>%
group_by(continent) %>%
filter(continent == "Europe" & !is.na(mismanaged_plastic_waste_tonnes)) %>%
ggplot(aes(x = mismanaged_plastic_waste_tonnes,
y = reorder(entity, mismanaged_plastic_waste_tonnes))) +
geom_point(size = 4) +
labs(x = "Mismanaged Plastic Waste (tonnes)",
y = "European Country",
title = "Mismanaged Plastic Waste",
subtitle = "Europe 2010") +
theme_economist()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment