stat_tab | R Documentation |
It is important to use variable label and value label to produce a proper
descriptive table. Variables with value labels will be converted to ordered
factor with same order as the value labels (to_factor
). And variable
labels will be used in the output. The first row will be blank with row names
of variable label. Variable name will be used if the variable does not have
a variable label.
stat_tab(
vars,
group = NULL,
data,
total = TRUE,
select = NULL,
add_missing = TRUE,
digits = 2,
digits_pct = 1,
rounding_fn = signif_pad,
render_num = "Median [Min, Max]",
logical_na_impute = FALSE
)
group |
Name of the grouping variable. |
data |
A |
total |
If a "Total" column will be created (default). Specify
|
select |
a named vector with as many components as row-variables. Every element of 'select' will be used to select the individuals to be analyzed for every row-variable. Name of the vector corresponds to the row variable, element is the selection. |
add_missing |
If missing number and missing percentage will be
reported in the summary table, default is 'TRUE'. This will also produce
data missingness report if set |
digits |
An integer specifying the number of significant digits to keep, default is 3. |
digits_pct |
An integer specifying the number of digits after the decimal place for percentages, default is 0. |
rounding_fn |
The function to use to do the rounding. Defaults is
|
render_num |
A character or vector indicating which summary will be reported,
default is "Median [Min, Max]". You can change this to "Median [Q1, Q3]" then the
median and IQR will be reported instead of "Median [Min, Max]". Use
|
logical_na_impute |
Impute missing values with |
An object of class "cttab".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.