Skip to contents

Generate a waterfall plot

Usage

waterfall_plot(
  data_recist,
  rc_sum = "RCTLSUM",
  rc_resp = "RCRESP",
  rc_date = "RCDT",
  type = c("best_resp", "worst_resp", "timepoint"),
  timepoint = NULL,
  rc_star = NULL,
  arm = NULL,
  warn_missing = TRUE
)

Arguments

data_recist

recist table, one row

rc_sum

name of the target lesions length sum column in data_recist, usually "RCTLSUM".

rc_resp

name of the response column in data_recist, usually "RCRESP".

rc_date

unused for now

type

one of c("best_resp", "worst_resp")

timepoint

unused for now

rc_star

name of the logical column in data_recist that triggers the . Can be set to NULL.

arm

name of the treatment column in data_recist. Can be set to NULL to not group.

warn_missing

whether to warn about missing values

Value

a ggplot

Examples


if (FALSE) {
waterfall_plot(rc, rc_date=RCDT, rc_sum=RCTLSUM, rc_resp=RCRESP)
waterfall_plot(rc_date=RCDT, rc_sum=RCTLSUM, rc_resp=RCRESP, rc_star="RCNEW")
rc %>% 
  left_join(arm, by="SUBJID") %>%
  waterfall_plot(rc_date=RCDT, rc_sum=RCTLSUM, rc_resp=RCRESP, arm=ARM) +
  NULL
}