Skip to content

Instantly share code, notes, and snippets.

View clauswilke's full-sized avatar

Claus Wilke clauswilke

View GitHub Profile
@gadenbuie
gadenbuie / join-animations-with-gganimate.R
Last active January 11, 2022 15:48
Animated dplyr joins with gganimate
# Animated dplyr joins with gganimate
# * Garrick Aden-Buie
# * garrickadenbuie.com
# * MIT License: https://opensource.org/licenses/MIT
# Note: I used Fira Sans and Fira Mono fonts.
# Use search and replace to use a different font if Fira is not available.
library(tidyverse)
library(gganimate)
library(gganimate) # thomasp85/gganimate
library(cartogram)
library(geogrid) # Need github version jbaileyh/geogrid
library(rnaturalearth)
library(sf)
library(scico)
us <- ne_states('united states of america', returnclass = 'sf')
us <- us[!us$woe_name %in% c('Alaska', 'Hawaii'), ]
us <- st_transform(us, '+proj=eqdc +lat_0=39 +lon_0=-96 +lat_1=33 +lat_2=45 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs')