Skip to content

Commit f680ab7

Browse files
authored
Merge branch 'main' into 977_tidy_t_summary@main
2 parents a580d23 + 0eeaed9 commit f680ab7

File tree

5 files changed

+54
-51
lines changed

5 files changed

+54
-51
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: teal.modules.clinical
22
Title: Teal Modules for Standard Clinical Outputs
3-
Version: 0.8.16.9046
4-
Date: 2024-02-01
3+
Version: 0.8.16.9047
4+
Date: 2024-02-02
55
Authors@R: c(
66
person("Joe", "Zhu", , "joe.zhu@roche.com", role = c("aut", "cre")),
77
person("Jana", "Stoilova", , "jana.stoilova@roche.com", role = "aut"),

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# teal.modules.clinical 0.8.16.9046
1+
# teal.modules.clinical 0.8.16.9047
22

33
### Breaking Changes
44
+ Adapted all modules to use `teal_data` objects.

R/tm_t_summary_by.R

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#' Template: Summarize Variables by Row Groups Module
22
#'
3+
#' Creates a valid expression to generate a table to summarize variables by row groups.
4+
#'
35
#' @inheritParams template_arguments
4-
#' @param parallel_vars (`logical`)\cr used to display `summarize_vars` as parallel columns
5-
#' (`FALSE` on default). Can be used only if all chosen analysis variables are numeric.
6-
#' @param row_groups (`logical`)\cr used to display `summarize_vars` as row groups
7-
#' (`FALSE` on default).
8-
#' @param numeric_stats (`character`)\cr
9-
#' selected statistics for numeric summarize variables to be displayed. Possible values are `n`, `mean_sd`, `mean_ci`,
10-
#' `median`, `median_ci`, `quantiles`, `range`. All are selected by default.
11-
#' @param drop_zero_levels (`logical`)\cr used to remove rows with zero counts from the result table.
6+
#' @param parallel_vars (`logical`)\cr whether summarized variables should be arranged in columns. Can only be set to
7+
#' `TRUE` if all chosen analysis variables are numeric.
8+
#' @param row_groups (`logical`)\cr whether summarized variables should be arranged in row groups.
9+
#' @param drop_zero_levels (`logical`)\cr whether rows with zero counts in all columns should be removed from the table.
10+
#'
11+
#' @inherit template_arguments return
1212
#'
1313
#' @seealso [tm_t_summary_by()]
14-
#' @keywords internal
1514
#'
15+
#' @keywords internal
1616
template_summary_by <- function(parentname,
1717
dataname,
1818
arm_var,
@@ -106,7 +106,6 @@ template_summary_by <- function(parentname,
106106
)
107107
}
108108

109-
110109
table_title <- paste("Summary Table for", paste(sum_vars, collapse = ", "), "by", paste(by_vars, collapse = ", "))
111110

112111
parsed_basic_table_args <- teal.widgets::parse_basic_table_args(
@@ -314,21 +313,18 @@ template_summary_by <- function(parentname,
314313
y
315314
}
316315

317-
#' Teal Module: Summarize Variables by Row Groups Module
316+
#' teal Module: Summarize Variables by Row Groups
317+
#'
318+
#' This module produces a table to summarize variables by row groups.
318319
#'
319-
#' @param drop_arm_levels (`logical`)\cr drop the unused `arm_var` levels.
320-
#' When `TRUE`, `arm_var` levels are set to those used in the `dataname` dataset. When `FALSE`,
321-
#' `arm_var` levels are set to those used in the `parentname` dataset.
322-
#' If `dataname` dataset and `parentname` dataset are the same (i.e. `ADSL`), then `drop_arm_levels` will always be
323-
#' TRUE regardless of the user choice when `tm_t_summary_by` is called.
324-
#' @param numeric_stats (`character`)\cr
325-
#' selected statistics for numeric summarize variables to be displayed. Possible values are `n`, `mean_sd`, `mean_ci`,
326-
#' `median`, `median_ci`, `range`, `geom_mean`. By default, `n`, `mean_sd`, `median`, `range` are selected.
327-
#' @param drop_zero_levels (`logical`)\cr used to remove rows with zero counts from the result table.
328320
#' @inheritParams module_arguments
329321
#' @inheritParams template_summary_by
330322
#'
331-
#' @export
323+
#' @inherit module_arguments return
324+
#'
325+
#' @seealso The [TLG Catalog](https://insightsengineering.github.io/tlg-catalog/stable/) where additional example
326+
#' apps implementing this module can be found.
327+
#'
332328
#' @examples
333329
#' ADSL <- tmc_ex_adsl
334330
#' ADLB <- tmc_ex_adlb
@@ -370,6 +366,8 @@ template_summary_by <- function(parentname,
370366
#' if (interactive()) {
371367
#' shinyApp(app$ui, app$server)
372368
#' }
369+
#'
370+
#' @export
373371
tm_t_summary_by <- function(label,
374372
dataname,
375373
parentname = ifelse(
@@ -455,7 +453,7 @@ tm_t_summary_by <- function(label,
455453
)
456454
}
457455

458-
#' @noRd
456+
#' @keywords internal
459457
ui_summary_by <- function(id, ...) {
460458
ns <- shiny::NS(id)
461459
a <- list(...)
@@ -576,8 +574,7 @@ ui_summary_by <- function(id, ...) {
576574
)
577575
}
578576

579-
580-
#' @noRd
577+
#' @keywords internal
581578
srv_summary_by <- function(id,
582579
data,
583580
reporter,

man/template_summary_by.Rd

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

man/tm_t_summary_by.Rd

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

0 commit comments

Comments
 (0)