Boxes and arrows tracing participants from screening through analysis, laid out automatically from a stage/count table.
geom_consort(mapping = NULL, data = NULL, box_fill = NULL, label_size = NULL)A Layer to add with +.
d <- data.frame(
stage = c("Assessed for eligibility", "Randomised",
"Received allocation", "Analysed"),
n = c(420, 300, 291, 285)
)
ggnext(d, aes(label = stage, size = n)) + geom_consort()
#> <ggnext plot>
#> data: 4 x 2
#> aes: label = stage, size = n
#> layers: 1
#> coord: cartesian
#> mode: static