pretty_tbl_df: Create a pretty table from a dataframe to pass to Kable for...

Description Usage Arguments Value Examples

View source: R/summary_table_functions.R

Description

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.

Usage

1
2
3
4
5
6
7
pretty_tbl_df(
  df,
  vars_to_char = NULL,
  r = 0,
  vars_to_specify_rounding = NULL,
  confint = TRUE
)

Arguments

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?

Value

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

Examples

1

joelewis101/blantyreSepsis documentation built on Aug. 30, 2021, 11:16 p.m.