diff --git a/NAMESPACE b/NAMESPACE index 8cb6e86..3905dd0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,6 +10,7 @@ export(build_lookup) export(check_subjid) export(crf_status_plot) export(edc_browse_excel) +export(edc_crf_plot) export(edc_data_stop) export(edc_data_warn) export(edc_data_warnings) diff --git a/NEWS.md b/NEWS.md index ce0ced3..7ac7612 100644 --- a/NEWS.md +++ b/NEWS.md @@ -47,7 +47,7 @@ EDCimport is a package designed to easily import data from EDC software TrialMas - New function `search_for_newer_data()` to search a path (e.g. Downloads) for a newer data archive (#46). -- New function `crf_status_plot()` to show the current database completion status (#48). +- New function `edc_crf_plot()` to show the current database completion status (#48). - New function `save_sessioninfo()`, to save `sessionInfo()` into a text file (#42). diff --git a/R/crf_status.R b/R/crf_status.R index 4dc2270..34deacd 100644 --- a/R/crf_status.R +++ b/R/crf_status.R @@ -19,12 +19,12 @@ #' @examples #' \dontrun{ #' #import a TM database and use load_list(), then: -#' crf_status_plot() + ggtitle(date_extraction) -#' crf_status_plot(pal=rev(edc_pal_crf())) -#' crf_status_plot(details=TRUE, treat_as_worst="No Data") -#' crf_status_plot(x_label="{crfname} (N={n_id}, n={nrow})") +#' 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 = crf_status_plot(details=TRUE) +#' 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" @@ -38,7 +38,7 @@ #' @importFrom scales label_percent #' @importFrom stringr str_subset #' @importFrom tibble tibble -crf_status_plot = function(crfstat_col="CRFSTAT", +edc_crf_plot = function(crfstat_col="CRFSTAT", ..., details=FALSE, pal = edc_pal_crf(), @@ -80,9 +80,12 @@ crf_status_plot = function(crfstat_col="CRFSTAT", labs(x=NULL, y="Dataset", fill="CRF Status") } +#' @rdname edc_crf_plot +#' @usage NULL +#' @export +crf_status_plot = edc_crf_plot - -#' @rdname crf_status_plot +#' @rdname edc_crf_plot #' @export #' @source `ggsci:::ggsci_db$lancet[["lanonc"]] %>% dput()` edc_pal_crf = function(){ diff --git a/_pkgdown.yml b/_pkgdown.yml index 4fa4368..5ca974c 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -29,7 +29,8 @@ reference: - assert_no_duplicate - edc_warn_patient_diffs - edc_warn_extraction_date - - crf_status_plot + - edc_crf_plot + - edc_patient_gridplot - edc_population_plot - title: "Project management" - contents: diff --git a/man/crf_status_plot.Rd b/man/edc_crf_plot.Rd similarity index 85% rename from man/crf_status_plot.Rd rename to man/edc_crf_plot.Rd index 6a407ff..6f93be3 100644 --- a/man/crf_status_plot.Rd +++ b/man/edc_crf_plot.Rd @@ -1,6 +1,7 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/crf_status.R -\name{crf_status_plot} +\name{edc_crf_plot} +\alias{edc_crf_plot} \alias{crf_status_plot} \alias{edc_pal_crf} \title{Show the current CRF status distribution} @@ -8,7 +9,7 @@ \code{ggsci:::ggsci_db$lancet[["lanonc"]] \%>\% dput()} } \usage{ -crf_status_plot( +edc_crf_plot( crfstat_col = "CRFSTAT", ..., details = FALSE, @@ -44,12 +45,12 @@ Generate a barplot showing the distribution of CRF status (Complete, Incomplete, \examples{ \dontrun{ #import a TM database and use load_list(), then: -crf_status_plot() + ggtitle(date_extraction) -crf_status_plot(pal=rev(edc_pal_crf())) -crf_status_plot(details=TRUE, treat_as_worst="No Data") -crf_status_plot(x_label="{crfname} (N={n_id}, n={nrow})") +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 = crf_status_plot(details=TRUE) +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"