Add a blank row below each variable group defined by variables
or below each
specified row_numbers
. A blank row will not be added to the bottom of the table.
NOTE: For HTML flextable output (which includes the RStudio IDE Viewer), the blank rows do not render. But they will appear when the table is rendered to Word.
add_blank_rows(x, variables = NULL, row_numbers = NULL, variable_level = NULL)
(gtsummary
)
a 'gtsummary' table. The table must include a column named 'variable'
in x$table_body
.
(tidy-select
or integer
)
variables
: When a table contains variable summaries, use this argument
to add blank rows below the specified variable block.
row_numbers
: Add blank rows after each row number specified.
variable_level
: A single column name in x$table_body
and blank rows
will be added after each unique level.
updated 'gtsummary' table.
# Example 1 ----------------------------------
# Default to every variable used
trial |>
tbl_roche_summary(
by = trt,
include = c(age, marker, grade),
nonmissing = "always"
) |>
add_blank_rows(variables = everything())
Drug A
(N = 98)
Drug B
(N = 102)
# Example 2 ----------------------------------
trial |>
tbl_roche_summary(
by = trt,
include = c(age, marker, grade),
nonmissing = "always"
) |>
add_blank_rows(variables = age)
Drug A
(N = 98)
Drug B
(N = 102)