View source: R/tbl_continuous.R
tbl_continuous | R Documentation |
experimental Summarize a continuous variable by one or more categorical variables
tbl_continuous(
data,
variable,
include = everything(),
digits = NULL,
by = NULL,
statistic = NULL,
label = NULL
)
data |
A data frame |
variable |
Variable name of the continuous column to be summarized |
include |
variables to include in the summary table. Default is |
digits |
List of formulas specifying the number of decimal places to round continuous summary statistics. If not specified, an appropriate number of decimals to round statistics will be guessed based on the the variable's distribution. |
by |
A column name (quoted or unquoted) in |
statistic |
List of formulas specifying types of summary statistics
to display for each variable. The default is
|
label |
List of formulas specifying variables labels,
e.g. |
a gtsummary table
Example 1
Example 2
Review list, formula, and selector syntax used throughout gtsummary
Other tbl_continuous tools:
add_overall()
,
add_p.tbl_continuous()
# Example 1 ----------------------------------
tbl_continuous_ex1 <-
tbl_continuous(
data = trial,
variable = age,
by = trt,
include = grade
)
# Example 2 ----------------------------------
tbl_continuous_ex2 <-
tbl_continuous(
data = trial,
variable = age,
include = c(trt, grade)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.