librarian::shelf(tidyverse, readr, tsibble, lubridate) devtools::load_all()
feb <- read_rds('data/feb_projections.rds') feb_long <- pivot_longer(feb, cols = where(is.numeric), values_to = 'feb') jul <- get_cbo_projections() jul_long <- pivot_longer(jul, cols = where(is.numeric), values_to = 'jul')
comparison <- inner_join(feb_long, jul_long, by = c('date', 'name', 'id')) %>% pivot_longer(c(feb, jul), names_to = 'source') comparison_nested <- comparison %>% filter_index("2021 Q2" ~ "2023 Q4") %>% group_by(name) %>% nest() %>% mutate(plot = map2(.x = name, .y = data, .f = ~comparison_plot(.data = .y, variable = .x))) plots <- rlang::set_names(comparison_nested$plot, comparison_nested$name)
plots$c
plots$gdp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.