Description Usage Arguments Value Examples
The fmt_table1
function calculates descriptive statistics by groups for
continuous, categorical, and dichotomous variables. Review the fmt_table1
vignette for detailed examples.
1 2 3 |
data |
data frame. |
by |
a character name of a categorical variable in data, |
label |
A list of variable labels,
e.g. |
type |
A list that includes specified summary types. Accepted values
are |
statistic |
A list of the type of statistics to return. The list can contain
two names lists ( |
digits |
integer indicating the number of decimal places to round continuous
summary statistics. |
id |
Character vector of an ID or grouping variable. Summary statistics
will not be printed for this column. The column may be used in |
missing |
whether to include |
Data frame including formatted descriptive statistics.
1 2 3 4 5 6 7 | fmt_table1(trial, by = "trt")
# convert numeric 'am' to factor to display nicely in header
mtcars %>%
dplyr::mutate(am = factor(am, c(0, 1), c("Automatic", "Manual"))) %>%
fmt_table1(by = "am") %>%
add_comparison()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.