Generate a barplot showing the distribution of CRF status (Complete, Incomplete, ...) for each dataset of the database.
Usage
edc_crf_plot(
crfstat_col = "CRFSTAT",
...,
details = FALSE,
pal = edc_pal_crf(),
crfstat_lvls = names(pal),
x_label = "{dataset}",
treat_as_worst = NULL
)
edc_pal_crf()
Arguments
- crfstat_col
the column name of the CRF status
- ...
unused
- details
whether to show all the CRF status levels. When
FALSE
(default), recode the status into "Complete", "Incomplete", or "No Data".- pal
the palette, defaulting to the helper
EDCimport:::edc_pal_crf()
- crfstat_lvls
the CRF status levels, from "best" to "worst". The plot is ordered by the "worst" level.
- x_label
a glue pattern determining the tick label in the x axis. Available variables are
c("nrow", "ncol", "n_id", "rows_per_id", "crfname")
, taken fromedc_lookup()
.- treat_as_worst
a regex for levels that should be treated as worst in the ordering
Examples
if (FALSE) { # \dontrun{
#import a TM database and use load_list(), then:
edc_crf_plot() + ggtitle(date_extraction)
edc_crf_plot(pal=rev(edc_pal_crf()))
edc_crf_plot(details=TRUE, treat_as_worst="No Data")
edc_crf_plot(x_label="{crfname} (N={n_id}, n={nrow})")
p = edc_crf_plot(details=TRUE)
p$data$crfstat %>% unique()
#> [1] "Incomplete" "No Data Locked" "No Data" "Signed"
#> [5] "Partial Monitored" "Monitored" "Complete Locked" "Complete"
} # }