Project Part 2

Interactive and static plots of daily hours spent with digital media from 2008 to 2018

  1. Packages I will use to read in and plot the data
  1. Read the data in from part 1
daily_hours_spent <- read_csv(here::here("daily-hours-spent-with-digital-media-per-adult-user.csv"))

Interactive graph

daily_hours_spent %>% 
  group_by(`Mobile (BOND Internet Trends (2019))`, `Desktop/Laptop (BOND Internet Trends (2019))`, `Other Connected Devices (BOND Internet Trends (2019))`) %>% 
  e_charts(x = Year) %>% 
  e_river(serie = `Mobile (BOND Internet Trends (2019))`, legend = FALSE) %>% 
  e_tooltip(trigger = "axis") %>% 
  e_title(text = "Daily hours spent with digital media",
          subtext = "Source: Our World in Data",
          sublink = "https://ourworldindata.org/grapher/daily-hours-spent-with-digital-media-per-adult-user?country=~USA",
          left = "center") %>% 
  e_theme("roma")

Static Graph

daily_hours_spent %>% 
  ggplot(aes(x = Year, y = `Mobile (BOND Internet Trends (2019))`, `Desktop/Laptop (BOND Internet Trends (2019))`, `Other Connected Devices (BOND Internet Trends (2019))`, fill = Code)) +
  geom_area() +
  colorspace::scale_fill_discrete_divergingx(palette = "roma", nmax = 3) +
  theme_classic() +
  theme(legend.position = "bottom") +
  labs(y =  "Daily hours spent",
       fill = NULL)

These plots show a steady increase in daily hours spent with digital media since 2008. Daily hours spent have continued to increase.

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