Skip to content

Commit 9d52672

Browse files
committed
Add datasets_selected argument
1 parent 9d193d3 commit 9d52672

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

R/tm_missing_data.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#'
88
#' @inheritParams teal::module
99
#' @inheritParams shared_params
10+
#' @inheritParams tm_data_table
1011
#' @param parent_dataname (`character(1)`) Specifies the parent dataset name. Default is `ADSL` for `CDISC` data.
1112
#' If provided and exists, enables additional analysis "by subject". For non-`CDISC` data, this parameter can be
1213
#' ignored.
@@ -110,6 +111,7 @@
110111
tm_missing_data <- function(label = "Missing data",
111112
plot_height = c(600, 400, 5000),
112113
plot_width = NULL,
114+
datasets_selected = character(0L),
113115
parent_dataname = "ADSL",
114116
ggtheme = c("classic", "gray", "bw", "linedraw", "light", "dark", "minimal", "void"),
115117
ggplot2_args = list(
@@ -143,6 +145,7 @@ tm_missing_data <- function(label = "Missing data",
143145
lower = plot_width[2], upper = plot_width[3], null.ok = TRUE, .var.name = "plot_width"
144146
)
145147

148+
checkmate::assert_character(datasets_selected)
146149
checkmate::assert_character(parent_dataname, min.len = 0, max.len = 1)
147150
ggtheme <- match.arg(ggtheme)
148151

@@ -158,9 +161,11 @@ tm_missing_data <- function(label = "Missing data",
158161
assert_decorators(decorators, null.ok = TRUE, names = available_decorators)
159162
# End of assertions
160163

164+
datasets_selected <- unique(datasets_selected)
161165
ans <- module(
162166
label,
163167
server = srv_page_missing_data,
168+
datanames = if (length(datasets_selected) == 0) "all" else datasets_selected,
164169
server_args = list(
165170
parent_dataname = parent_dataname,
166171
plot_height = plot_height,
@@ -170,7 +175,6 @@ tm_missing_data <- function(label = "Missing data",
170175
decorators = decorators
171176
),
172177
ui = ui_page_missing_data,
173-
datanames = "all",
174178
ui_args = list(pre_output = pre_output, post_output = post_output)
175179
)
176180
attr(ans, "teal_bookmarkable") <- TRUE

man/tm_missing_data.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)