knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Let's load the cached data, and filter down to the United States of America.
library(covid19mobility) library(dplyr) #if you want to try this with fresh data # us_mobile <- refresh_covid19mobility_apple_country() %>% # filter(location_code == "US") us_mobile <- covid19mobility_apple_country_demo %>% filter(location_code == "US")
Now, let's plot it!
library(ggplot2) ggplot(us_mobile, aes(x = date, y = value, color = data_type)) + geom_line(size = 1) + theme_bw(base_size=14) + labs(color = "Mobility Type", y = "Relative Value", x = "") + ggtitle("Apple Mobility Trends")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.