Add a blank row below each variable group. 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_row(x)
add_blank_row(x)
x |
( |
updated 'gtsummary' table
gtsummary::trial |> tbl_demographics( by = trt, include = c(age, marker, grade) ) |> add_blank_row()
gtsummary::trial |> tbl_demographics( by = trt, include = c(age, marker, grade) ) |> add_blank_row()
Round p-values
roche_pvalue( x, big.mark = ifelse(decimal.mark == ",", " ", ","), decimal.mark = getOption("OutDec"), ... ) label_roche_pvalue( big.mark = ifelse(decimal.mark == ",", " ", ","), decimal.mark = getOption("OutDec"), ... )
roche_pvalue( x, big.mark = ifelse(decimal.mark == ",", " ", ","), decimal.mark = getOption("OutDec"), ... ) label_roche_pvalue( big.mark = ifelse(decimal.mark == ",", " ", ","), decimal.mark = getOption("OutDec"), ... )
x |
( |
big.mark |
( |
decimal.mark |
( |
... |
Arguments passed on to |
A character vector of rounded p-values
x <- c(0.0000001, 0.123456) roche_pvalue(x) label_roche_pvalue()(x)
x <- c(0.0000001, 0.123456) roche_pvalue(x) label_roche_pvalue()(x)
This is a thin wrapper of gtsummary::tbl_summary()
with the following differences:
Default summary type for continuous variables is 'continuous2'
.
Number of non-missing observations is added for each variable by default and placed on the row under the header.
The tbl_summary(missing*)
arguments have been renamed to
tbl_demographics(nonmissing*)
with updated default values.
The default footnotes from tbl_summary()
are removed.
tbl_demographics( data, by = NULL, label = NULL, statistic = list(all_continuous() ~ c("{mean} ({sd})", "{median}", "{min} - {max}"), all_categorical() ~ "{n} ({p}%)"), digits = NULL, type = NULL, value = NULL, nonmissing = c("always", "ifany", "no"), nonmissing_text = "n", nonmissing_stat = "{N_nonmiss}", sort = all_categorical(FALSE) ~ "alphanumeric", percent = c("column", "row", "cell"), include = everything() )
tbl_demographics( data, by = NULL, label = NULL, statistic = list(all_continuous() ~ c("{mean} ({sd})", "{median}", "{min} - {max}"), all_categorical() ~ "{n} ({p}%)"), digits = NULL, type = NULL, value = NULL, nonmissing = c("always", "ifany", "no"), nonmissing_text = "n", nonmissing_stat = "{N_nonmiss}", sort = all_categorical(FALSE) ~ "alphanumeric", percent = c("column", "row", "cell"), include = everything() )
data |
( |
by |
( |
label |
( |
statistic |
( |
digits |
( |
type |
( |
value |
( |
nonmissing , nonmissing_text , nonmissing_stat
|
Arguments dictating how and if missing values are presented:
|
sort |
( |
percent |
( |
include |
( |
a 'gtsummary' table
# Example 1 ---------------------------------- gtsummary::trial |> tbl_demographics( by = trt, include = c(age, grade) )
# Example 1 ---------------------------------- gtsummary::trial |> tbl_demographics( by = trt, include = c(age, grade) )
A gtsummary theme for Roche tables
Calls the gtsummary::theme_gtsummary_compact()
theme.
Uses label_roche_pvalue()
as the default formatting function for all p-values.
Defaults to a mono-spaced font for gt tables.
theme_gtsummary_roche(set_theme = TRUE, font_size = NULL)
theme_gtsummary_roche(set_theme = TRUE, font_size = NULL)
set_theme |
(scalar |
font_size |
(scalar |
theme list
theme_gtsummary_roche() tbl_demographics(gtsummary::trial, by = trt, include = c(age, grade)) gtsummary::reset_gtsummary_theme()
theme_gtsummary_roche() tbl_demographics(gtsummary::trial, by = trt, include = c(age, grade)) gtsummary::reset_gtsummary_theme()