fmt_table1
objects.If the top row of a header column is blank,
you may experience printing issues when using knitr
::kable
# S3 method for fmt_table1
modify_header(x, label = NULL, stat_by = NULL,
stat_overall = NULL, pvalue = NULL, ...)
fmt_table1
object
string vector including text to appear above the label column
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
.
string vector including text to appear above the overall summary
statistics. N
, the total number of observations, is available for use in the
description.
string vector including text to appear above the p-value column
further arguments passed to or from other methods
# NOT RUN {
trial %>% fmt_table1(by = "trt") %>% modify_header(stat_by = c("{level}", "N = {n} ({p}%)"))
# }
Run the code above in your browser using DataLab