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)

Arguments

mapping, data

Standard layer overrides. Map the stage label to label and the participant count to size; map x to a stage index to control ordering.

box_fill

Box fill color.

label_size

Text size in px.

Value

A Layer to add with +.

Examples

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