A function to convert TableTree to .rtf
tt_to_tlgrtf(
tt,
file = NULL,
orientation = c("portrait", "landscape"),
colwidths = def_colwidths(tt, fontspec, col_gap = col_gap, label_width_ins =
label_width_ins, type = tlgtype),
label_width_ins = 2,
watermark = NULL,
pagenum = ifelse(tlgtype == "Listing", TRUE, FALSE),
fontspec = font_spec("Times", 9L, 1.2),
pg_width = pg_width_by_orient(orientation == "landscape"),
margins = c(0, 0, 0, 0),
paginate = tlg_type(tt) == "Table",
col_gap = ifelse(tlgtype == "Listing", 0.5, 3),
nosplitin = list(row = character(), col = character()),
verbose = FALSE,
tlgtype = tlg_type(tt),
string_map = default_str_map,
markup_df = dps_markup_df,
combined_rtf = FALSE,
one_table = TRUE,
border_mat = make_header_bordmat(obj = tt),
round_type = obj_round_type(tt),
alignments = list(),
validate = TRUE,
...
)If file is non-NULL, this is called for the side-effect of writing
one or more RTF files. Otherwise, returns a list of huxtable objects.
(TableTree)
TableTree object to convert to RTF
(character(1))
File to create, including path, but excluding
.rtf extension.
(character)
Orientation of the output ("portrait" or "landscape")
(numeric vector)
Column widths for the table
(numeric)
Label width in inches
(optional) String containing the desired watermark for RTF outputs. Vectorized.
(logical)
Whether to add page numbers to the output.
Only applicable to listings (i.e. it is ignored for tables and figures).
(font_spec)
Font specification object
(numeric)
Page width in inches
(numeric vector)
Margins in inches (top, right, bottom, left)
(logical)
Whether to paginate the output
(numeric)
Column gap in spaces
(list)
list(row=, col=). Path elements whose children should not be paginated within
if it can be avoided. e.g., list(col="TRT01A") means don't split within treatment arms unless
all the associated columns don't fit on a single page.
(logical)
Whether to print verbose output
(character)
Type of the output (Table, Listing, or Figure)
(data.frame)
Unicode mapping for special characters
(data.frame)
Data frame containing markup information
(logical(1))
In the case where the result is broken up into multiple
parts due to width, should a combined rtf file also be created. Defaults to FALSE.
(logical(1))
If tt is a (non-MatrixPrintForm) list,
should the parts be added to the rtf within a single table (TRUE, the
default) or as separate tables. End users will not generally need to set this.
(matrix)
A m x k matrix where m is the number of columns of tt
and k is the number of lines the header takes up. See tidytlg::add_bottom_borders
for what the matrix should contain. Users should only specify this when the
default behavior does not meet their needs.
(character(1))
the type of rounding to perform.
See formatters::format_value() for more details.
(list)
List of named lists. Vectorized.
(Default = list()) Used to specify individual column or cell alignments.
Each named list contains row, col, and value, which are passed to
huxtable::set_align() to set the alignments.
logical(1). Whether to validate the table structure using
rtables::validate_table_struct(). Defaults to TRUE. If FALSE, a message
will be displayed when validation fails.
Additional arguments passed to gentlg
This function aids in converting the rtables TableTree into the desired .rtf file.