Learn R Programming

gtsummary (version 0.1.0)

add_stat_label: Adds a column showing a label for the summary statistics shown in each row

Description

Rather than simply printing the summary statistics, with the use of add_stat_label(), a column labeling the summary statistics is added.

Usage

add_stat_label(x, iqr = TRUE)

Arguments

x

object with class fmt_table1 from the fmt_table1 function

iqr

logical indicator whether 'q1, q2' and 'p25, p75' should resolve to 'IQR'. Default is TRUE

Examples

Run this code
# NOT RUN {
mtcars %>% fmt_table1() %>% add_stat_label()
mtcars %>% fmt_table1(by = "am") %>% add_stat_label(iqr = FALSE)
# }

Run the code above in your browser using DataLab