feat: added add difference option to overview
Some checks are pending
pkgdown.yaml / pkgdown (push) Waiting to run

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-12-11 22:48:30 +01:00
commit 2a580965e3
No known key found for this signature in database
22 changed files with 159 additions and 36 deletions

View file

@ -1 +1 @@
app_version <- function()'25.12.3'
app_version <- function()'25.12.5'

View file

@ -37,7 +37,7 @@ baseline_table <- function(data, fun.args = NULL, fun = gtsummary::tbl_summary,
#' mtcars |> create_baseline(by.var = "gear", detail_level = "extended",type = list(gtsummary::all_dichotomous() ~ "categorical"),theme="nejm")
#'
#' create_baseline(default_parsing(mtcars), by.var = "am", add.p = FALSE, add.overall = FALSE, theme = "lancet")
create_baseline <- function(data, ..., by.var, add.p = FALSE, add.overall = FALSE, theme = c("jama", "lancet", "nejm", "qjecon"), detail_level = c("minimal", "extended")) {
create_baseline <- function(data, ..., by.var, add.p = FALSE, add.diff=FALSE, add.overall = FALSE, theme = c("jama", "lancet", "nejm", "qjecon"), detail_level = c("minimal", "extended")) {
theme <- match.arg(theme)
detail_level <- match.arg(detail_level)
@ -100,6 +100,10 @@ create_baseline <- function(data, ..., by.var, add.p = FALSE, add.overall = FALS
gtsummary::add_p() |>
gtsummary::bold_p()
}
if (isTRUE(add.diff)) {
out <- out |>
gtsummary::add_difference()
}
}
out

View file

@ -1 +1 @@
hosted_version <- function()'v25.12.3-251211'
hosted_version <- function()'v25.12.5-251211'

Binary file not shown.

View file

@ -400,10 +400,20 @@ ui_elements <- function(selection) {
"Yes" = "yes"
)
),
shiny::helpText(i18n$t("Option to perform statistical comparisons between strata in baseline table."))
# shiny::helpText(i18n$t("Option to perform statistical comparisons between strata in baseline table.")),
shiny::br(),
shiny::radioButtons(
inputId = "add_diff",
label = i18n$t("Include group differences"),
selected = "no",
inline = TRUE,
choices = list(
"No" = "no",
"Yes" = "yes"
)
)
),
shiny::br(),
shiny::br(),
shiny::actionButton(
inputId = "act_eval",
label = i18n$t("Evaluate"),