powered by
For each variable in a tbl_summary table, the add_n function adds a column with the total number of non-missing (or missing) observations
tbl_summary
add_n
add_n(x, missing = FALSE, last = FALSE)
Object with class tbl_summary from the tbl_summary function
Logical argument indicating whether to print N (missing = FALSE), or N missing (missing = TRUE). Default is FALSE
missing = FALSE
missing = TRUE
FALSE
Logical indicator to include N column last in table. Default is FALSE, which will display N column first.
A tbl_summary object
Other tbl_summary tools: add_overall, add_p, add_q.tbl_summary, add_stat_label, bold_italicize_labels_levels, bold_p.tbl_summary, inline_text.tbl_summary, modify_header, sort_p.tbl_summary, tbl_summary
add_overall
add_p
add_q.tbl_summary
add_stat_label
bold_italicize_labels_levels
bold_p.tbl_summary
inline_text.tbl_summary
modify_header
sort_p.tbl_summary
# NOT RUN { tbl_n_ex <- trial %>% dplyr::select(trt, age, grade, response) %>% tbl_summary(by = trt) %>% add_n() # }
Run the code above in your browser using DataLab