Created
March 13, 2021 20:42
-
-
Save epijim/22eeca4ad6b1c205cc2544996bd772e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go to https://github.com/FortAwesome/Font-Awesome/tree/master/webfonts | |
# and install fa-solid-900.ttf, fa-regular-400.ttf and fa-brands-400.ttf | |
# then run extrafont::font_import() | |
library(tidyverse) | |
library(ggplot2) | |
library(waffle) | |
extrafont::loadfonts() | |
# From LEAP supplemental appendix | |
control_event <- 54 | |
control_noevent <- 260 | |
intervention_event <- 10 | |
intervention_noevent <- 304 | |
tribble( | |
~outcome, ~group, ~n, | |
"Allergy", "Peanut avoidance - control group", control_event, | |
"No allergy", "Peanut avoidance - control group", control_noevent, | |
"Allergy", "Peanut exposed - intervention group",intervention_event, | |
"No allergy", "Peanut exposed - intervention group",intervention_noevent | |
) %>% | |
ggplot(aes(label = outcome, colour = outcome, values = n)) + | |
geom_pictogram(size=5, n_rows = 8) + | |
facet_wrap(~group, ncol=1) + | |
scale_x_discrete(expand=c(0,0)) + | |
scale_y_discrete(expand=c(0,0)) + | |
scale_color_manual( | |
name = NULL, | |
values = c("#b30000","#009bda") | |
) + | |
scale_label_pictogram( | |
name = NULL, | |
values = c("frown-open","meh") | |
) + | |
coord_equal() + | |
labs( | |
title = "Observed events within LEAP by intervention or control group" | |
) + | |
#theme_ipsum_rc(grid="") + | |
theme_enhance_waffle() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment