Learn R Programming

gtsummary (version 1.2.0)

as_kable: Convert to knitr_kable object

Description

Function converts gtsummary objects to a knitr_kable objects. This function is used in the background when the results are printed or knit. A user can use this function if they wish to add customized formatting available via knitr::kable.

Usage

as_kable(x, include = NULL, exclude = NULL, ...)

Arguments

x

Object created by a function from the gtsummary package (e.g. tbl_summary or tbl_regression)

include

Character vector naming kable commands to include in printing. Default is NULL, which utilizes all commands in x$kable_calls.

exclude

Character vector naming kable commands to exclude in printing. Default is NULL.

...

Additional arguments passed to knitr::kable

Value

A knitr_kable object

See Also

tbl_summary tbl_regression tbl_uvregression tbl_survival

Examples

Run this code
# NOT RUN {
trial %>%
  tbl_summary(by = trt) %>%
  as_kable()
# }

Run the code above in your browser using DataLab