Learn R Programming

rtables (version 0.4.0)

tt_to_flextable: Create a FlexTable object representing an rtables TableTree

Description

Create a FlexTable object representing an rtables TableTree

Usage

tt_to_flextable(
  tt,
  paginate = FALSE,
  lpp = NULL,
  ...,
  colwidths = propose_column_widths(tt),
  total_width = 5
)

Arguments

tt

TableTree (or related class). A TableTree object representing a populated table.

paginate

logical(1). Should tt be paginated and exported as multiple flextables. Defaults to FALSE

lpp

numeric. Maximum lines per page including (re)printed header and context rows

...

Passed on to metthods or tabulation functions.

colwidths

numeric vector. Column widths for use with vertical pagination. Currently ignored.

total_width

numeric(1). Total width in inches for the resulting flextable(s). Defaults to 5.

Value

a flextable object

Examples

Run this code
# NOT RUN {
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)
ft <- tt_to_flextable(tbl)
ft
# }

Run the code above in your browser using DataLab