class: inverse, left, bottom background-image: url(https://images.unsplash.com/photo-1542204165-65bf26472b9b?auto=format&fit=crop&q=80&w=1548&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D) background-size: cover # .Large[# My featurette] ## .small[featuring [{}]() ...] #### .tiny[Gina Reynolds | 2023-10-25 |Image credit: Denise Jans, Upsplash] ??? Title --- ```r library(tidyverse) library(ggcirclepack) # tidytuesday data rladies_chapters_raw <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-11-21/rladies_chapters.csv') %>% mutate(chapter = str_remove(chapter, "rladies-") %>% str_replace_all("-", " ") %>% str_to_title() %>% str_remove("\\s+$")) ``` --- count: false .panel1-feature-auto[ ```r *rladies_chapters_raw ``` ] .panel2-feature-auto[ ``` ## # A tibble: 4,268 × 6 ## id chapter title date location year ## <dbl> <chr> <chr> <date> <chr> <dbl> ## 1 296275584 St Louis "Save the date! Introduction t… 2023-11-30 online 2023 ## 2 296277517 Coventry "An basic introduction: Python… 2023-11-30 online 2023 ## 3 295898711 Baltimore "Holiday graphics and animatio… 2023-11-28 inperson 2023 ## 4 296346610 Philly "TidyTuesday with R-Ladies Phi… 2023-11-14 online 2023 ## 5 296275461 St Louis "Save the date! Introduction t… 2023-11-08 online 2023 ## 6 296424871 Kathmandu "4 days workshop" 2023-11-01 inperson 2023 ## 7 296239571 Taipei "旅遊服務銜接 AIGC 的各種坑" 2023-10-30 inperson 2023 ## 8 296559481 Montreal "RLadies October Meetup - \"R-… 2023-10-30 inperson 2023 ## 9 296677321 Abuja "R-Ladies Abuja and Abuja R us… 2023-10-28 inperson 2023 ## 10 296720878 Sao Paulo "Meetup R-Ladies São Paulo - I… 2023-10-28 inperson 2023 ## # ℹ 4,258 more rows ``` ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% * ggplot() ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_02_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + * aes(x = "all", y = "all") ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_03_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + * stat_bin_2d(alpha = .85) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_04_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + stat_bin_2d(alpha = .85) + * stat_bin_2d(geom = "text", * aes(label = after_stat(count)), * color = "oldlace", * size = 3) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_05_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + stat_bin_2d(alpha = .85) + stat_bin_2d(geom = "text", aes(label = after_stat(count)), color = "oldlace", size = 3) + * aes(y = wday(date, label = T, * week_start = "Monday") |> fct_rev()) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_06_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + stat_bin_2d(alpha = .85) + stat_bin_2d(geom = "text", aes(label = after_stat(count)), color = "oldlace", size = 3) + aes(y = wday(date, label = T, week_start = "Monday") |> fct_rev()) + * scale_fill_viridis_c(option = "magma", end = .75) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_07_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + stat_bin_2d(alpha = .85) + stat_bin_2d(geom = "text", aes(label = after_stat(count)), color = "oldlace", size = 3) + aes(y = wday(date, label = T, week_start = "Monday") |> fct_rev()) + scale_fill_viridis_c(option = "magma", end = .75) + * aes(y = year(date) |> as.character() |> fct_rev()) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_08_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + stat_bin_2d(alpha = .85) + stat_bin_2d(geom = "text", aes(label = after_stat(count)), color = "oldlace", size = 3) + aes(y = wday(date, label = T, week_start = "Monday") |> fct_rev()) + scale_fill_viridis_c(option = "magma", end = .75) + aes(y = year(date) |> as.character() |> fct_rev()) + * aes(y = month(date, label = T)|> fct_rev()) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_09_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + stat_bin_2d(alpha = .85) + stat_bin_2d(geom = "text", aes(label = after_stat(count)), color = "oldlace", size = 3) + aes(y = wday(date, label = T, week_start = "Monday") |> fct_rev()) + scale_fill_viridis_c(option = "magma", end = .75) + aes(y = year(date) |> as.character() |> fct_rev()) + aes(y = month(date, label = T)|> fct_rev()) + * aes(x = year(date) |> as.character()) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_10_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r rladies_chapters_raw %>% ggplot() + aes(x = "all", y = "all") + stat_bin_2d(alpha = .85) + stat_bin_2d(geom = "text", aes(label = after_stat(count)), color = "oldlace", size = 3) + aes(y = wday(date, label = T, week_start = "Monday") |> fct_rev()) + scale_fill_viridis_c(option = "magma", end = .75) + aes(y = year(date) |> as.character() |> fct_rev()) + aes(y = month(date, label = T)|> fct_rev()) + aes(x = year(date) |> as.character()) + * aes(x = as.factor(day(date))) ``` ] .panel2-feature-auto[ ![](stat-sum-lubridate_files/figure-html/feature_auto_11_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> --- ```r ggwipe::last_plot_wipe_last() + # remove text layer, experimental facet_wrap(~year(date), nrow = 1) + scale_x_discrete(breaks = as.character(1:31), # clean up x axis labels = c("1", rep("", 8), "10", rep("", 9), "20", rep("", 10), "31")) + labs(x = "Day of Month") + theme(panel.background = element_rect(fill = "darkgrey"), panel.grid = element_blank()) + guides(fill = "colorbar") ``` ![](stat-sum-lubridate_files/figure-html/unnamed-chunk-2-1.png)<!-- --> --- ### Contribute - https://github.com/EvaMaeRey/ggcirclepack --- ### Check out {packcircles} which does the computation in ggcirclepack - https://github.com/mbedward/packcircles --- ### 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: 100%} @media print { .has-continuation { display: block; } } </style>