Project Part II

Interactive and Static Plots for Alcohol Consumption in High Income Countries from 1890 to 2014

These are the R packages that I will use to read and plot the data


Read the data in from Part I

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

Interactive Graph

consumption %>%
  mutate(Ounces = round(Ounces, 1),
         Year = paste(Year, sep = "-")) %>%
  group_by(Country) %>% 
  e_charts(x = Year) %>% 
  e_line(serie = Ounces, legend = FALSE) %>% 
  e_tooltip(trigger = "axis") %>%
  e_title(text = "Alcohol Consumption from 1890 to 2014 for High Income Countries",
          subtext = "In Ounces, Source: Our World in Data",
          sublink = "https://ourworldindata.org/alcohol-consumption",
          left = "center") %>% 
  e_theme("dark-fresh-cut")

This graph displays the alcohol consumption per capita for High Income Countries from 1890 to 2014 in Ounces.


Static Graph

consumption %>% 
  filter(Country == "United States") %>% 
  ggplot() +
  geom_point(aes(x = Year, y = Ounces)) +
  geom_smooth(aes(x = Year, y = Ounces)) +
  labs(subtitle = "Alcohol Consumption for The United States in Ounces from 1890 to 2014", x = NULL, y = NULL)+
  theme_test()

Alcohol consumption in The United States of America has been steadily increasing by a few ounces year over year since 1890. Data from 1920 does not exist due to Prohibition.

ggsave(filename = "preview.png", path = here::here("_posts", "2022-05-04-project-part-ii"))