knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.showtext = TRUE, dpi = 300 )
library(pkgact) library(dplyr) library(ggplot2) library(showtext) library(sf) showtext::showtext_auto() showtext::showtext_opts(dpi = 300)
Here's a chart
edu %>% select(-moe) %>% group_by(name) %>% mutate(share = estimate / estimate[1]) %>% filter(variable == "masters") %>% ggplot(aes(x = name, y = share)) + geom_col(width = 0.8) + labs(x = NULL, y = "Share", title = "Share of adults ages 25+ with a master's degree, 2016") + theme_din()
And a map
ggplot(counties, aes(fill = pop_density)) + geom_sf(color = "darkslateblue") + scale_fill_fermenter(direction = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.