Description Usage Arguments Value Examples
View source: R/summary_table_functions.R
Take a dataframe and make a new summary dataframe to pass to Kable for pretty table rendering. The input is assumed to have variables in columns with observations in rows.Numeric variables are by default summarised by median and IQR. Character vectors are assumed to be factors and a summarised as a proportion for each level.
1 2 3 4 5 6 7 |
df |
dataframe to make into pretty table |
vars_to_char |
character vector of names of numeric variables that you want to treat as factors |
r |
numeric, number of digits to round to |
vars_to_specify_rounding |
named numeric vector c("varname" = m) to hange default rounding for variable varname |
confint |
boolean, do you want to report confidence intervals? |
A dataframe with three columns: variable: the original column name levels: the levels of a character variable (one row for each) level OR the text "Median (IQR)" for numeric variables value: the proportion of observations for that level OR median (IQR) for numeric variables
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.