modify_header.fmt_table1: Modifies header rows for existing 'fmt_table1' objects.

Description Usage Arguments Examples

Description

If the top row of a header column is blank, you may experience printing issues when using knitr::kable

Usage

1
2
3
## S3 method for class 'fmt_table1'
modify_header(x, label = NULL, stat_by = NULL,
  stat_overall = NULL, pvalue = NULL, ...)

Arguments

x

fmt_table1 object

label

string vector including text to appear above the label column

stat_by

string vector of text to include above the summary statistics stratified by a variable. The following fields are available for use in the headers: n, N, p, name, and level. n is the number of observations in each by group. N is the total number of observations. p is the percentage of rows in a by group. name is the name of the by variable. level is the by variable level. Syntax follows the glue::glue() function, e.g. stat_by = c("{level}", "N = {n} ({p}\%)"). Must specify by along with stat_by.

stat_overall

string vector including text to appear above the overall summary statistics. N, the total number of observations, is available for use in the description.

pvalue

string vector including text to appear above the p-value column

...

further arguments passed to or from other methods

Examples

1
trial %>% fmt_table1(by = "trt") %>% modify_header(stat_by = c("{level}", "N = {n} ({p}%)"))

ddsjoberg/gtsummary-v0.1 documentation built on June 4, 2019, 7:48 a.m.