Project Part 2

Interactive and static plots of prevalence of depression, males v.s. females

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

Interactive graph

myxaxis <- "Prevalence_in_females"
myyaxis <- "Prevalence_in_males"

regional_prevalence %>%
  group_by(Region) %>% 
  e_charts_(x = myxaxis) %>% 
  e_scatter_(serie = myyaxis,symbol_size = 7) %>%
  e_grid(right = '30%') %>% 
  e_legend(orient = 'vertical', right = '5', top = '15%') %>%
  e_tooltip(axisPointer = list(type = "cross")) %>% 
  e_title(text = "Prevalence of depression, males(y-axis) vs. females(x-axis), 2019",
          subtext = "(Percent based on population historical estimates) Source: Our World in Data",
          sublink =
            "https://ourworldindata.org/mental-health#prevalence-of-depressive-disorders",
          left = "center")%>%
  e_theme("roma")

Static graph

ggplot(regional_prevalence) +
  geom_point(aes(x = Prevalence_in_females, y = Prevalence_in_males, colour = 'regions')) +
  theme(legend.position = "bottom") +
  labs(y = "Prevalence in males", fill = NULL) +
  labs(x = "Prevalence in females", fill = NULL) +
  labs(subtitle = "Prevalence of depression, males vs. females, 2019")

These plots show that in 2019 women suffer more from depressive disorders than males. however they are still relatively close to each other.

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