Learn R Programming

gtsummary (version 0.1.0)

add_n: Adds a column with N (or N missing) for each variable

Description

The function assumes the DEFAULT header are in use. Only modify header rows after all columns has been added.

Usage

add_n(x, missing = FALSE, last = FALSE)

Arguments

x

object with class fmt_table1 from the fmt_table1 function

missing

logical argument indicating whether to print N (missing = FALSE), or N missing (missing = TRUE). Default is FALSE

last

logical indicator to include overall column last. Default is FALSE

Examples

Run this code
# NOT RUN {
trial %>% fmt_table1(by = "trt") %>% add_n()
# }

Run the code above in your browser using DataLab