From 603d542f3a1350fd3311c1cdad97e5e40f7e66ab Mon Sep 17 00:00:00 2001 From: Derek Sonderegger Date: Sun, 8 Oct 2023 12:20:44 -0700 Subject: [PATCH] Update add_stat_label() (#1544) * Trying to make the help text more concise and clear. * More concise and more accurate. * Update DESCRIPTION --------- Co-authored-by: Daniel Sjoberg --- R/add_stat_label.R | 7 +++++++ man/add_stat_label.Rd | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/R/add_stat_label.R b/R/add_stat_label.R index 51c8cb24d4..021b3c2784 100644 --- a/R/add_stat_label.R +++ b/R/add_stat_label.R @@ -26,6 +26,13 @@ #' tbl_merge(list(tbl1, tbl2)) #' ``` #' +#' The addition of the new `"stat_label"` column requires a default +#' labels for categorical variables, which is `"No. (%)"`. This +#' can be changed to either desired text or left blank using `NA_character_`. +#' The blank option is useful in the `location="row"` case to keep the +#' output for categorical variables identical what was produced without +#' a `"add_stat_label()"` function call. +#' #' @param x Object with class `tbl_summary` from the [tbl_summary] function #' or with class `tbl_svysummary` from the [tbl_svysummary] function #' @param location location where statistic label will be included. diff --git a/man/add_stat_label.Rd b/man/add_stat_label.Rd index 5eedf0b544..1da2404fea 100644 --- a/man/add_stat_label.Rd +++ b/man/add_stat_label.Rd @@ -46,6 +46,13 @@ tbl2 <- lm(marker ~ age + grade, trial) \%>\% tbl_regression() tbl_merge(list(tbl1, tbl2)) }\if{html}{\out{}} + +The addition of the new \code{"stat_label"} column requires a default +labels for categorical variables, which is \code{"No. (\%)"}. This +can be changed to either desired text or left blank using \code{NA_character_}. +The blank option is useful in the \code{location="row"} case to keep the +output for categorical variables identical what was produced without +a \code{"add_stat_label()"} function call. } \section{Example Output}{