Created
March 13, 2018 15:18
-
-
Save hrbrmstr/42aff98aca45d29f4cda5e731bacdd8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(waffle) | |
library(viridis) | |
library(tidyverse) | |
data_frame( | |
country = c("Rest of World", "Canada*", "Brazil*", "South Korea", "Mexico", | |
"Russia", "Turkey", "Japan", "Taiwan", "Germany", "India"), | |
pct = c(22, 16, 13, 10, 9, 9, 7, 5, 4, 3, 2) | |
) %>% | |
mutate(country = sprintf("%s (%s%%)", country, pct)) %>% | |
waffle( | |
colors = c("gray70", viridis_pal(option = "plasma")(10)) | |
) + | |
labs( | |
title = "U.S. Steel Imports — YTD 2017 Percent of Volume", | |
subtitle = "Ten nations account for ~80% of U.S. steel imports.", | |
caption = "Source: IHS Global Trade Atlas • YTD through September 2017\n* Canada & Brazil are not impacted by the proposed tariffs" | |
) + | |
theme_ipsum_ps() + | |
theme(legend.position = "top") + | |
theme(axis.text = element_blank()) + | |
theme(title = element_text(hjust=0.5)) + | |
theme(plot.title = element_text(hjust=0.5)) + | |
theme(plot.subtitle = element_text(hjust=0.5)) + | |
theme(plot.caption = element_text(hjust=1)) |
Thank you so much for your helpful answer. It worked perfectly!
My IFTTT rule to notify abt gist comments magically started working again. Unfortunately I missed this. Issues on the repo may not get addressed immediately but they'll generally be seen earlier than gist comments (there's no built-in notification for gist comments)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had this issue also when I was using version
0.7.0
of the waffle package. When I installed the development version (0.8.0
), this resolved the error.