Project Part 2

Interactive and static plots of world death from drug abuse 1900 to 2019

  1. Packages I will use to read in and plot the data
  1. Read the data in from part 1
regional_deaths <- read_csv(here::here("regional_deaths.csv"))

Interactive graph

regional_deaths %>% 
  rename(drug_use=1,alcohol_disorders=2, illicit_drug=4) %>% 
  pivot_longer(cols = 1:5, names_to = "description", values_to = "n") %>% 
  arrange(n) %>% 
  e_charts(description) %>% 
  e_bar(n,legend=FALSE) %>% 
  e_flip_coords() %>% 
  e_tooltip(trigger = "axis") %>% 
  e_title(text = "Annual regional deaths, by world region") 

Static graph

regional_deaths   %>% 
  pivot_longer(cols = 1:5, names_to = "description", values_to = "n") %>% 
  ggplot(aes(x = description, y = n))+ 
 geom_col() +
  coord_flip()+
  theme_classic() +
  theme(legend.position = "bottom") +
  labs( y = "Annual regional deaths, by world region")

These plots show a steady increase in deaths since 1900. deaths have continued to increase.

ggsave(filename =here::here("_posts/2022-05-16-project-part-2/preview.png"))