-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtemplate_summary.Rd
More file actions
82 lines (68 loc) · 4 KB
/
template_summary.Rd
File metadata and controls
82 lines (68 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tm_t_summary.R
\name{template_summary}
\alias{template_summary}
\title{Template: Summary of Variables}
\usage{
template_summary(
dataname,
parentname,
arm_var,
sum_vars,
add_total = TRUE,
total_label = default_total_label(),
var_labels = character(),
arm_var_labels = NULL,
na.rm = FALSE,
na_level = tern::default_na_str(),
numeric_stats = c("n", "mean_sd", "mean_ci", "median", "median_ci", "quantiles",
"range", "geom_mean"),
numeric_formats = NULL,
denominator = c("N", "n", "omit"),
drop_arm_levels = TRUE,
basic_table_args = teal.widgets::basic_table_args()
)
}
\arguments{
\item{dataname}{(\code{character})\cr analysis data used in teal module.}
\item{parentname}{(\code{character})\cr parent analysis data used in teal module, usually this refers to \code{ADSL}.}
\item{arm_var}{(\code{character})\cr variable names that can be used as \code{arm_var}.}
\item{sum_vars}{(\code{character})\cr names of the variables that should be summarized.}
\item{add_total}{(\code{logical})\cr whether to include column with total number of patients.}
\item{total_label}{(\code{string})\cr string to display as total column/row label if column/row is
enabled (see \code{add_total}). Defaults to \code{"All Patients"}. To set a new default \code{total_label} to
apply in all modules, run \code{set_default_total_label("new_default")}.}
\item{var_labels}{(named \code{character}) optional\cr variable labels for relabeling the analysis variables.}
\item{arm_var_labels}{(\code{character} or \code{NULL})\cr vector of column variable labels to display, of the same length as
\code{arm_var}. If \code{NULL}, no labels will be displayed.}
\item{na.rm}{(\code{logical})\cr whether \code{NA} values should be removed prior to analysis.}
\item{na_level}{(\code{string})\cr used to replace all \code{NA} or empty values
in character or factor variables in the data. Defaults to \code{"<Missing>"}. To set a
default \code{na_level} to apply in all modules, run \code{set_default_na_str("new_default")}.}
\item{numeric_stats}{(\code{character})\cr names of statistics to display for numeric summary variables. Available
statistics are \code{n}, \code{mean_sd}, \code{mean_ci}, \code{median}, \code{median_ci}, \code{quantiles}, \code{range}, and \code{geom_mean}.}
\item{numeric_formats}{(named \code{list} or \code{NULL})\cr format patterns for numeric statistics. Names should match the
statistics in \code{numeric_stats}. If \code{NULL}, defaults from \code{\link[tern:analyze_variables]{tern::analyze_vars()}} are used.}
\item{denominator}{(\code{character})\cr chooses how percentages are calculated. With option \code{N}, the reference
population from the column total is used as the denominator. With option \code{n}, the number of non-missing
records in this row and column intersection is used as the denominator. If \code{omit} is chosen, then the
percentage is omitted.}
\item{drop_arm_levels}{(\code{logical})\cr whether to drop unused levels of \code{arm_var}. If \code{TRUE}, \code{arm_var} levels are
set to those used in the \code{dataname} dataset. If \code{FALSE}, \code{arm_var} levels are set to those used in the
\code{parentname} dataset. If \code{dataname} and \code{parentname} are the same, then \code{drop_arm_levels} is set to \code{TRUE} and
user input for this parameter is ignored.}
\item{basic_table_args}{(\code{basic_table_args}) optional\cr object created by \code{\link[teal.widgets:basic_table_args]{teal.widgets::basic_table_args()}}
with settings for the module table. The argument is merged with option \code{teal.basic_table_args} and with default
module arguments (hard coded in the module body).
For more details, see the vignette: \code{vignette("custom-basic-table-arguments", package = "teal.widgets")}.}
}
\value{
a \code{list} of expressions to generate a table or plot object.
}
\description{
Creates a valid expression to generate a table to summarize variables.
}
\seealso{
\code{\link[=tm_t_summary]{tm_t_summary()}}
}
\keyword{internal}