Project Part 2

Interactive and static plots of drug deaths from 2010 to 2019

Katie Kuehn
2022-05-15

Part 2

1. Packages that I will use to read in and plot the data:

2. Read the data in from Part 1:

regional_drugdeaths <- read_csv(here::here("regional_drugdeaths.csv"))

Interactive Graph

regional_drugdeaths %>%
  group_by(Region) %>%
  mutate(DeathsfromDrugUse = round(DeathsfromDrugUse, 2),
         Year = paste(Year, "12", "31", sep="-")) %>%
  e_charts(x = Year) %>%
  e_river(serie = DeathsfromDrugUse, legend = FALSE) %>%
  e_tooltip(trigger = "axis") %>%
  e_title(text = "Annual Drug Deaths, by World Region",
          subtext = "(per 100,000 people). Source: Our World in Data",
          sublink = "https://ourworldindata.org/illicit-drug-use#deaths-from-drug-use-disorders",
          left = "center") %>%
  e_theme("wonderland")

Static Graph

regional_drugdeaths %>%
  ggplot(aes(x = Year, y = DeathsfromDrugUse, fill = Region)) +
  geom_area() +
  colorspace::scale_fill_discrete_divergingx(palette = "ArmyRose", nmax = 12) +
  theme_classic() +
  theme(legend.position = "bottom") +
  labs(y = "per 100,000 people",
       fill = NULL)
ggsave(filename = "preview.png",
       path = here::here("_posts", "2022-05-15-project-part-2"))

These plots show that the United States has been the leader in deaths from illicit drug use. Since 2010, deaths have continued to increase at a rapid rate. Deaths in 2019 were double what they were in 2010.