Generate a waterfall plot
Arguments
- data_recist
recist dataset
- 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
name of the date column in
data_recist
, usually "RCDT".- type
one of
c("best_resp", "worst_resp")
- rc_star
name of the column in
data_recist
that triggers the star symbol. The column should be character or factor, withNA
for patients without symbol.- arm
name of the treatment column in
data_recist
. Can be left toNULL
to not group.- warnings
whether to warn about any problems
Examples
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")
} # }