class: inverse, left, bottom background-image: url(https://images.unsplash.com/photo-1504196606672-aef5c9cefc92?auto=format&fit=crop&q=60&w=500&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTZ8fGJhbGxvb25zfGVufDB8fDB8fHww) background-size: cover # .Large[#'Global Human Day' featurette] ## .small[featuring [{ggcirclepack}](https://github.com/EvaMaeRey/ggcirclepack) which is experimental] #### .tiny[Gina Reynolds | 2023-10-25 |Image credit: Gaelle Marcel, Upsplash] ??? Title --- ```r # tidytuesday data tt_url <- "https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-10-31/horror_articles.csv" library(tidyverse) library(ggcirclepack) read_csv(tt_url) %>% count(rating) -> article_rating_count ``` count: false .panel1-feature-auto[ ```r *article_rating_count ``` ] .panel2-feature-auto[ ``` ## # A tibble: 11 × 2 ## rating n ## <chr> <int> ## 1 false 113 ## 2 legend 61 ## 3 miscaptioned 1 ## 4 mixture 10 ## 5 mostly false 5 ## 6 partly true 2 ## 7 probably false 1 ## 8 true 50 ## 9 undetermined 6 ## 10 unproven 3 ## 11 was true; now outdated 1 ``` ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% * ggplot() ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_02_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + * aes(id = as_factor(rating) %>% paste0("'", . ,"'")) ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_03_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + * geom_circlepack() ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_04_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + * coord_equal() ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_05_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + * aes(fill = n) ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_06_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + * geom_circlepack_text(color = "white") ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_07_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + * aes(area = n) ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_08_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + aes(area = n) + * scale_fill_viridis_c(end = .7, option = "inferno") ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_09_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + aes(area = n) + scale_fill_viridis_c(end = .7, option = "inferno") + * scale_size_continuous(range = c(2, 6)) ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_10_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + aes(area = n) + scale_fill_viridis_c(end = .7, option = "inferno") + scale_size_continuous(range = c(2, 6)) + * ggstamp::theme_void_fill(fill = "darkred") ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_11_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + aes(area = n) + scale_fill_viridis_c(end = .7, option = "inferno") + scale_size_continuous(range = c(2, 6)) + ggstamp::theme_void_fill(fill = "darkred") + * theme(legend.position = "none") ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_12_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + aes(area = n) + scale_fill_viridis_c(end = .7, option = "inferno") + scale_size_continuous(range = c(2, 6)) + ggstamp::theme_void_fill(fill = "darkred") + theme(legend.position = "none") + * labs(title = "Snopes investigation outcomes on 'horror articles'") ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_13_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + aes(area = n) + scale_fill_viridis_c(end = .7, option = "inferno") + scale_size_continuous(range = c(2, 6)) + ggstamp::theme_void_fill(fill = "darkred") + theme(legend.position = "none") + labs(title = "Snopes investigation outcomes on 'horror articles'") + * theme(text = element_text(size = 15)) ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_14_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r article_rating_count %>% ggplot() + aes(id = as_factor(rating) %>% paste0("'", . ,"'")) + geom_circlepack() + coord_equal() + aes(fill = n) + geom_circlepack_text(color = "white") + aes(area = n) + scale_fill_viridis_c(end = .7, option = "inferno") + scale_size_continuous(range = c(2, 6)) + ggstamp::theme_void_fill(fill = "darkred") + theme(legend.position = "none") + labs(title = "Snopes investigation outcomes on 'horror articles'") + theme(text = element_text(size = 15)) + * ggstamp::stamp_wash(alpha = .2, fill = "darkred") ``` ] .panel2-feature-auto[ ![](horror-articles_files/figure-html/feature_auto_15_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> --- --- ### 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