cosm_sum: Cosmetics for summary tables Adds some cosmetics to tables of...

View source: R/misc_functions.R

cosm_sumR Documentation

Cosmetics for summary tables Adds some cosmetics to tables of descriptive statistics generated by tbl_summary.

Description

Cosmetics for summary tables Adds some cosmetics to tables of descriptive statistics generated by tbl_summary.

Usage

cosm_sum(gt_tbl, pad = 3, bold = FALSE, head_label = "**Variable**")

Arguments

gt_tbl

A table object generated by tbl_summary.

pad

Numerical, padding above and bellow rows.

bold

Display labels in bold?

head_label

Character, label to be used as head for the variable's column.

Details

Function cosm_sum adds some cosmetics to tables generated by tbl_summary, then converts the table as a huxtable and sets proper alignment.

Value

A huxtable.

Examples

require(dplyr, quietly = TRUE)

data(Oncho)
Oncho %>%
  select(-id) %>%
  tbl_summary() %>%
  cosm_sum(bold = TRUE) %>%
  theme_pubh(1)

pubh documentation built on Nov. 14, 2023, 1:08 a.m.