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)


camille-s/pkgact documentation built on Dec. 19, 2021, 12:56 p.m.