class: inverse, left, bottom background-image: url(https://images.unsplash.com/photo-1606482659485-8b5c3623a609?q=80&w=1473&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D) background-size: cover # .Large[# An advent of code calendar] ## .Small[featuring ... [{ggcalendar}](https://github.com/EvaMaeRey/ggcalendar)] #### .small[Gina Reynolds | 2023-12-04 |Image credit: Elena Mozhvilo, Upsplash] ??? Title --- ## Build dates data frame ```r library(tidyverse) "2023-12-01" %>% as_date() + days(0:30) -> december_vec c(NA, NA, NA, "make calendar", "make 9 pies", "circle pack counting", "pivot w OOP", "RUGS check", "smoothfit", "slice", "nc w sf", "org extenders", "sample") %>% c(., rep(NA,31-length(.))) %>% tibble(todo = .) %>% mutate(date = december_vec) -> advent_df ``` --- count: false .panel1-feature-auto[ ```r *library(ggcalendar) ``` ] .panel2-feature-auto[ ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) *advent_df ``` ] .panel2-feature-auto[ ``` ## # A tibble: 31 × 2 ## todo date ## <chr> <date> ## 1 <NA> 2023-12-01 ## 2 <NA> 2023-12-02 ## 3 <NA> 2023-12-03 ## 4 make calendar 2023-12-04 ## 5 make 9 pies 2023-12-05 ## 6 circle pack counting 2023-12-06 ## 7 pivot w OOP 2023-12-07 ## 8 RUGS check 2023-12-08 ## 9 smoothfit 2023-12-09 ## 10 slice 2023-12-10 ## # ℹ 21 more rows ``` ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% * ggcalendar(dates_df = .) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_03_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + * aes(date = date) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_04_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + * geom_tile_calendar(color = "oldlace", * linewidth = .5, * alpha = .75) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_05_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + * aes(fill = date >= Sys.Date()) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_06_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + * scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), * label = c("past", "future")) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_07_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), label = c("past", "future")) + * geom_text_calendar(alpha = .2, size = 8) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_08_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), label = c("past", "future")) + geom_text_calendar(alpha = .2, size = 8) + * geom_text_calendar( * aes(label = str_wrap(todo, 7)), * lineheight = .7, * alpha = .8) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_09_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), label = c("past", "future")) + geom_text_calendar(alpha = .2, size = 8) + geom_text_calendar( aes(label = str_wrap(todo, 7)), lineheight = .7, alpha = .8) + * theme(text = element_text(size = 20)) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_10_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), label = c("past", "future")) + geom_text_calendar(alpha = .2, size = 8) + geom_text_calendar( aes(label = str_wrap(todo, 7)), lineheight = .7, alpha = .8) + theme(text = element_text(size = 20)) + * labs(fill = NULL) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_11_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), label = c("past", "future")) + geom_text_calendar(alpha = .2, size = 8) + geom_text_calendar( aes(label = str_wrap(todo, 7)), lineheight = .7, alpha = .8) + theme(text = element_text(size = 20)) + labs(fill = NULL) + * labs(title = "'Advent of Code'") ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_12_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), label = c("past", "future")) + geom_text_calendar(alpha = .2, size = 8) + geom_text_calendar( aes(label = str_wrap(todo, 7)), lineheight = .7, alpha = .8) + theme(text = element_text(size = 20)) + labs(fill = NULL) + labs(title = "'Advent of Code'") + * geom_tile_calendar(data = . %>% * filter(date == Sys.Date()), * fill = alpha("goldenrod2", .1), * color = "goldenrod3", * show.legend = F, * linewidth = 1.5) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_13_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcalendar) advent_df %>% ggcalendar(dates_df = .) + aes(date = date) + geom_tile_calendar(color = "oldlace", linewidth = .5, alpha = .75) + aes(fill = date >= Sys.Date()) + scale_fill_manual(values = c("darkolivegreen", "goldenrod3"), label = c("past", "future")) + geom_text_calendar(alpha = .2, size = 8) + geom_text_calendar( aes(label = str_wrap(todo, 7)), lineheight = .7, alpha = .8) + theme(text = element_text(size = 20)) + labs(fill = NULL) + labs(title = "'Advent of Code'") + geom_tile_calendar(data = . %>% filter(date == Sys.Date()), fill = alpha("goldenrod2", .1), color = "goldenrod3", show.legend = F, linewidth = 1.5) + * theme(strip.background = * element_rect(fill = alpha("darkseagreen4", .8))) ``` ] .panel2-feature-auto[ ![](advent-todo_files/figure-html/feature_auto_14_output-1.png)<!-- --> ] <style> .panel1-feature-auto { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-feature-auto { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-feature-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- --- ### Check out flipbookr, used to build this featurette - https://github.com/EvaMaeRey/flipbookr - discussion: https://github.com/EvaMaeRey/flipbookr/blob/master/docs/draft_jasa_submission.pdf --- ### Check out more featurettes - https://EvaMaeRey.github.io/featurette <style type="text/css"> .remark-code{line-height: 1.5; font-size: 80%} @media print { .has-continuation { display: block; } } </style>