Generate a waterfall plot
recist dataset
name of the target lesions length sum column in data_recist
, usually "RCTLSUM".
name of the response column in data_recist
, usually "RCRESP".
name of the date column in data_recist
, usually "RCDT".
one of c("best_resp", "worst_resp")
name of the column in data_recist
that triggers the star symbol. The column should be character or factor, with NA
for patients without symbol.
name of the treatment column in data_recist
. Can be left to NULL
to not group.
name of the subject identifier column in data_recist
.
whether to warn about any problems
a ggplot
Data are ordered on rc_date
.
if (FALSE) { # \dontrun{
waterfall_plot(rc, rc_date="RCDT", rc_sum="RCTLSUM", rc_resp="RCRESP")
waterfall_plot(rc, rc_date="RCDT", rc_sum="RCTLSUM", rc_resp="RCRESP", type="worst_resp")
rc %>%
left_join(enrolres, by="SUBJID") %>% #adds the ARM column
mutate(new_lesion = ifelse(RCNEW=="1-Yes", "New lesion", NA)) %>%
waterfall_plot(rc_date="RCDT", rc_sum="RCTLSUM", rc_resp="RCRESP",
arm="ARM", rc_star="new_lesion")
} # }