Description Usage Arguments Details Value
Functions for producing descriptive statistics for numeric and categorical data. The objective of these functions is to make it easier to produce "Table 1" for a manuscript.
Tables are seperately created for numeric and categorical variable, and need to be combined manually afterward (probably using bind_rows).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
data |
Data frame. |
... |
Columns to summarise. |
group |
Grouping variable for group summaries. |
round |
Number of digits for rounding statistics (where applicable). |
digits |
Number of significant digits to print (pad with zeroes if digits < round) |
total |
Logical. Should a total column be added? (Default is FALSE) This argument only matters when a grouping variable is provided. |
na.rm |
Logical. Should missing data be remove before computing summary statisitcs? (Default is FALSE) |
na_level |
String to display for missing levels. |
For numeric variables passed to table1_numeric, the returned summary statistics are means (mean) and standard deviations (sd). For categorical variables (i.e. factors) passed to table1_categorical, the returned summary statistics are counts (sum) and percentages (mean) of indicator variables for each level in a factor variable.
A tibble with as many rows as the number of columns provided to ..., and as many columns as levels in group. Cell values are glue objects.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.