class: center, middle, inverse, title-slide .title[ # #TidyTuesday ‘Global Human Day’ featurette ] .subtitle[ ## featuring
{ggcirclepack}
which is experimental ] .date[ ### October 25, 2023 ] --- ```r library(tidyverse) tt_data <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-09-12/global_human_day.csv" ) ``` count: false .panel1-feature-auto[ ```r *library(ggcirclepack) ``` ] .panel2-feature-auto[ ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) *tt_data ``` ] .panel2-feature-auto[ ``` ## # A tibble: 24 × 3 ## Subcategory hoursPerDay uncertainty ## <chr> <dbl> <dbl> ## 1 Active recreation 0.42 0.05 ## 2 Allocation 0.91 0.06 ## 3 Artifacts 0.42 0.02 ## 4 Buildings 0.22 0.08 ## 5 Energy 0.04 0.01 ## 6 Food growth & collection 0.81 0.05 ## 7 Food preparation 0.92 0.07 ## 8 Food processing 0.07 0.01 ## 9 Health care 0.2 0.2 ## 10 Human transportation 0.9 0.22 ## # ℹ 14 more rows ``` ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% * ggplot() ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_03_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + * aes(id = as_factor(Subcategory)) ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_04_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + * geom_polygon_circlepack() ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_05_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + * coord_equal() ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_06_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + * aes(fill = hoursPerDay) ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_07_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + * geom_text_circlepack(color = "white") ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_08_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + geom_text_circlepack(color = "white") + * aes(area = hoursPerDay) ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_09_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + geom_text_circlepack(color = "white") + aes(area = hoursPerDay) + * scale_fill_viridis_c(end = .8) ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_10_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + geom_text_circlepack(color = "white") + aes(area = hoursPerDay) + scale_fill_viridis_c(end = .8) + * scale_size_continuous(range = c(0, 6)) ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_11_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + geom_text_circlepack(color = "white") + aes(area = hoursPerDay) + scale_fill_viridis_c(end = .8) + scale_size_continuous(range = c(0, 6)) + * theme_void() ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_12_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + geom_text_circlepack(color = "white") + aes(area = hoursPerDay) + scale_fill_viridis_c(end = .8) + scale_size_continuous(range = c(0, 6)) + theme_void() + * theme(legend.position = "none") ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_13_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + geom_text_circlepack(color = "white") + aes(area = hoursPerDay) + scale_fill_viridis_c(end = .8) + scale_size_continuous(range = c(0, 6)) + theme_void() + theme(legend.position = "none") + * labs(title = "Time spent in a 'Global Human Day'") ``` ] .panel2-feature-auto[ ![](global_human_day_files/figure-html/feature_auto_14_output-1.png)<!-- --> ] --- count: false .panel1-feature-auto[ ```r library(ggcirclepack) tt_data %>% ggplot() + aes(id = as_factor(Subcategory)) + geom_polygon_circlepack() + coord_equal() + aes(fill = hoursPerDay) + geom_text_circlepack(color = "white") + aes(area = hoursPerDay) + scale_fill_viridis_c(end = .8) + scale_size_continuous(range = c(0, 6)) + theme_void() + theme(legend.position = "none") + labs(title = "Time spent in a 'Global Human Day'") + * theme(text = element_text(size = 18)) ``` ] .panel2-feature-auto[ ![](global_human_day_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> --- <img src="global_human_day_files/figure-html/feature-1.png" width="70%" style="display: block; margin: auto;" /> --- ### try {ggcirclepack} (experimental; subject to change) ```r remotes::install_github("EvaMaeRey/ggcirclepack") ``` ### Contribute/report issues/comment - https://github.com/EvaMaeRey/ggcirclepack/issues/ ### Check out {packcircles} which does the computation in ggcirclepack - https://github.com/mbedward/packcircles ---