as_gt | R Documentation |
Function converts a gtsummary object to a "gt_tbl"
object,
that is, a table created with gt::gt()
.
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 the gt package.
as_gt(x, include = everything(), return_calls = FALSE, ...)
x |
( |
include |
Commands to include in output. Input may be a vector of
quoted or unquoted names. tidyselect and gtsummary select helper
functions are also accepted.
Default is |
return_calls |
Logical. Default is |
... |
Arguments passed on to |
A gt_tbl
object
As of 2024-08-15, line breaks (e.g. '\n'
) do not render properly for PDF output.
For now, these line breaks are stripped when rendering to PDF with Quarto and R markdown.
Daniel D. Sjoberg
# Example 1 ----------------------------------
trial |>
tbl_summary(by = trt, include = c(age, grade, response)) |>
as_gt()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.