Most often used to annotate each bar with reason for ending study or, if applicable, active status.

geom_swimlane_text(x, y, label, ...)

Arguments

x

Typically subject identifier

y

Typically duration on study

label

Annotation text

...

Other options passed to ggtext::geom_richtext

Examples

library(ggplot2)

patient_disposition %>%
  dplyr::mutate(
    reason_off_study = tidyr::replace_na(reason_off_study, "→")
  ) %>%
  order_swimlane(subject, weeks_on_study, cohort) %>%
  ggplot() +
  geom_swimlane(subject, weeks_on_study, cohort) +
  ggsci::scale_fill_jco() +
  geom_swimlane_text(subject, weeks_on_study, reason_off_study) +
  theme_swimlane(legend.position = c(.9, .1)) %+replace%
  theme(axis.title.x = element_blank())