1- # ' Missing data module
1+ # ' Missing data analysis module
22# '
3- # ' Present analysis of missing observations and patients.
4- # ' specifically designed for use with `data.frames`.
3+ # ' Module analyzes missing data in `data.frame`s to help users explore missing observations and
4+ # ' gain insights into the completeness of their data.
5+ # ' It is useful for clinical data analysis within the context of CDISC standards and
6+ # ' adaptable for general data analysis purposes.
57# '
68# ' @inheritParams teal::module
79# ' @inheritParams shared_params
8- # ' @param parent_dataname (`character(1)`) If this `dataname` exists in then "the by subject"graph is displayed .
9- # ' For `CDISC` data. In non ` CDISC` data this can be ignored. Defaults to `"ADSL"` .
10- # ' @param ggtheme optional, (`character`) `ggplot2` theme to be used by default . Defaults to `" classic" `.
10+ # ' @param parent_dataname (`character(1)`) Specifies the parent dataset name. Default is `ADSL` for CDISC data .
11+ # ' If provided and exists, enables additional analysis "by subject". For non- CDISC data, this parameter can be ignored.
12+ # ' @param ggtheme (`character`, optional) Specifies the default `ggplot2` theme for plots . Defaults to `classic`.
1113# '
1214# ' @templateVar ggnames "Summary Obs", "Summary Patients", "Combinations Main", "Combinations Hist", "By Subject"
1315# ' @template ggplot2_args_multi
@@ -120,6 +122,7 @@ tm_missing_data <- function(label = "Missing data",
120122 )
121123}
122124
125+ # UI function for the missing data module (all datasets)
123126ui_page_missing_data <- function (id , pre_output = NULL , post_output = NULL ) {
124127 ns <- NS(id )
125128 shiny :: tagList(
@@ -144,6 +147,7 @@ ui_page_missing_data <- function(id, pre_output = NULL, post_output = NULL) {
144147 )
145148}
146149
150+ # Server function for the missing data module (all datasets)
147151srv_page_missing_data <- function (id , data , reporter , filter_panel_api , parent_dataname ,
148152 plot_height , plot_width , ggplot2_args , ggtheme ) {
149153 moduleServer(id , function (input , output , session ) {
@@ -230,6 +234,7 @@ srv_page_missing_data <- function(id, data, reporter, filter_panel_api, parent_d
230234 })
231235}
232236
237+ # UI function for the missing data module (single dataset)
233238ui_missing_data <- function (id , by_subject_plot = FALSE ) {
234239 ns <- NS(id )
235240
@@ -299,6 +304,7 @@ ui_missing_data <- function(id, by_subject_plot = FALSE) {
299304 )
300305}
301306
307+ # UI encoding for the missing data module (all datasets)
302308encoding_missing_data <- function (id , summary_per_patient = FALSE , ggtheme , datanames ) {
303309 ns <- NS(id )
304310
@@ -387,6 +393,7 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data
387393 )
388394}
389395
396+ # Server function for the missing data (single dataset)
390397srv_missing_data <- function (id , data , reporter , filter_panel_api , dataname , parent_dataname ,
391398 plot_height , plot_width , ggplot2_args ) {
392399 with_reporter <- ! missing(reporter ) && inherits(reporter , " Reporter" )
@@ -491,7 +498,7 @@ srv_missing_data <- function(id, data, reporter, filter_panel_api, dataname, par
491498 } else {
492499 labels <- ifelse(cols == new_col_name | cols == " " , cols , paste0(column_labels [cols ], " [" , cols , " ]" ))
493500 }
494- return ( labels )
501+ labels
495502 },
496503 env = list (
497504 new_col_name = new_col_name ,
0 commit comments