tt_to_flextable | R Documentation |
flextable
from an rtables
tablePrincipally used for export (export_as_docx()
), this function produces a flextable
from an rtables
table. If theme = NULL
, rtables
-like style will be used. Otherwise,
theme_docx_default()
will produce a .docx
-friendly table.
tt_to_flextable(
tt,
theme = theme_docx_default(tt),
border = flextable::fp_border_default(width = 0.5),
indent_size = NULL,
titles_as_header = TRUE,
footers_as_text = FALSE,
counts_in_newline = FALSE,
paginate = FALSE,
lpp = NULL,
cpp = NULL,
...,
colwidths = propose_column_widths(matrix_form(tt, indent_rownames = TRUE)),
tf_wrap = !is.null(cpp),
max_width = cpp,
total_width = 10
)
theme_docx_default(
tt = NULL,
font = "Arial",
font_size = 9,
bold = c("header", "content_rows", "label_rows"),
bold_manual = NULL,
border = flextable::fp_border_default(width = 0.5)
)
tt |
( |
theme |
( |
border |
( |
indent_size |
( |
titles_as_header |
( |
footers_as_text |
( |
counts_in_newline |
( |
paginate |
( |
lpp |
( |
cpp |
( |
... |
additional parameters passed to methods or tabulation functions. |
colwidths |
( |
tf_wrap |
( |
max_width |
( |
total_width |
( |
font |
( |
font_size |
( |
bold |
( |
bold_manual |
(named |
A flextable
object.
theme_docx_default()
: Main theme function for export_as_docx()
export_as_docx()
export_as_docx()
analysisfun <- function(x, ...) {
in_rows(
row1 = 5,
row2 = c(1, 2),
.row_footnotes = list(row1 = "row 1 - row footnote"),
.cell_footnotes = list(row2 = "row 2 - cell footnote")
)
}
lyt <- basic_table(
title = "Title says Whaaaat", subtitles = "Oh, ok.",
main_footer = "ha HA! Footer!"
) %>%
split_cols_by("ARM") %>%
analyze("AGE", afun = analysisfun)
tbl <- build_table(lyt, ex_adsl)
# rtables style
tt_to_flextable(tbl, theme = NULL)
tt_to_flextable(tbl, theme = theme_docx_default(tbl, font_size = 7))
# Custom theme
special_bold <- list(
"header" = list("i" = 1, "j" = c(1, 3)),
"body" = list("i" = c(1, 2), "j" = 1)
)
custom_theme <- theme_docx_default(tbl,
font_size = 10,
font = "Brush Script MT",
border = flextable::fp_border_default(color = "pink", width = 2),
bold = NULL,
bold_manual = special_bold
)
tt_to_flextable(tbl,
border = flextable::fp_border_default(color = "pink", width = 2),
theme = custom_theme
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.