Plastic Waste

Map visualization (especially choropleth)

Published

May 26, 2019

Notable topics: Map visualization (especially choropleth)

Recorded on: 2019-05-26

Timestamps by: Alex Cookson

View code

Screencast

Timestamps

summarise_all

Using summarise_all to get proportion of NA values across many variables

geom_text

Adding text labels to scatter plot for some points using check_overlap argument

pmin

Using pmin function to get the lower of two possible numbers for a percentage variable that was showing > 100%

Starting to make a choropleth map

Connecting ISO country names (used in mapping code) to country names given in the dataset

Actual code to create the map using given longitude and latitude

regex_left_join
fuzzyjoin

Using fuzzyjoin package to link variables that use regular expression instead of character (using regex_right_join / regex_left_join function)

coord_fixed

Using coord_fixed function as a hack to get proper ratios for maps

Bringing in additional data using WDI package

patchwork

Using patchwork package to show multiple graphs in the same plot

Importing and rename multiple indicators from the WDI package at the same time