Subjects ordered by best percent change from baseline, one bar each, with the +20% / -30% RECIST thresholds marked. Distinct from geom_waterfall(), which shows a running total.

geom_waterfall_response(
  mapping = NULL,
  data = NULL,
  thresholds = TRUE,
  alpha = NULL
)

Arguments

mapping, data

Standard layer overrides. Map the subject to x (or omit and let ordering supply it) and percent change to y; map color to response category.

thresholds

Draw the RECIST reference lines.

alpha

Bar opacity.

Value

A Layer to add with +.

Examples

set.seed(1)
d <- data.frame(
  subject = paste0("S", 1:20),
  pct = sort(runif(20, -75, 45), decreasing = TRUE)
)
ggnext(d, aes(subject, pct)) +
  geom_waterfall_response() +
  labs(title = "Best response", y = "% change from baseline", x = NULL)
#> <ggnext plot>
#>   data:  20 x 2
#>   aes:   x = subject, y = pct
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static