tbl_gtsummary | R Documentation |
gtsummary
Summarise a data.frame as gtsummary
with Dutch defaults. These objects are based on the gt
package by RStudio. To provide Certe style and compatibility with MS Word, use tbl_flextable()
to transform the gtsummary
object.
tbl_gtsummary(
x,
by = NULL,
label = NULL,
digits = 1,
...,
language = "nl",
column1_name = "Eigenschap",
add_n = FALSE,
add_p = FALSE,
add_ci = FALSE,
add_overall = FALSE,
decimal.mark = dec_mark(),
big.mark = big_mark()
)
x |
a data.frame |
by |
( |
label |
( |
digits |
( |
... |
Arguments passed on to |
language |
the language to use, defaults to Dutch |
column1_name |
name to use for the first column |
add_n |
add the overall N using |
add_p |
add the p values |
add_ci |
add the confidence interval using |
add_overall |
add the overall statistics using |
decimal.mark |
decimal separator, defaults to |
big.mark |
thousands separator, defaults to |
tbl_gtsummary()
creates a summary table with gtsummary::tbl_summary()
, to which different extra columns can be added e.g. with add_p = TRUE
and add_overall = TRUE
.
# These examples default to the Dutch language
iris |>
tbl_gtsummary()
iris |>
tbl_gtsummary(Species, add_p = TRUE)
iris |>
tbl_gtsummary(Species, add_n = TRUE)
# support strata by providing
iris2 <- iris
iris2$Category <- sample(LETTERS[1:2], size = 150, replace = TRUE)
head(iris2)
iris2 |>
tbl_gtsummary(c(Category, Species))
# transform to flextable
# (formats to Certe style and allows rendering to Word)
iris |>
tbl_gtsummary(Species) |>
tbl_flextable()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.