| summarytab | R Documentation |
Build a publication-style summary table of one or more variables, optionally stratified by a grouping column, in the manner of a clinical "Table 1".
summarytab(
data,
vars = NULL,
by = NULL,
overall = TRUE,
p_value = FALSE,
digits = 1
)
data |
A data.frame. |
vars |
Character vector of variables to summarize. Defaults to every
column other than |
by |
Optional single column name used to stratify the summary. |
overall |
Include an "Overall" column alongside the by-group columns. |
p_value |
Include a column of between-group p-values. Requires |
digits |
Number of decimal places used when formatting numbers. |
A basetable with one row per variable (or variable level), and one
column per stratum plus Overall/p_value as requested.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.