Get the RTF content from a gt_tbl
object as as a single-element character
vector. This object can be used with writeLines()
to generate a valid .rtf
file that can be opened by RTF readers.
Usage
as_rtf(
data,
incl_open = TRUE,
incl_header = TRUE,
incl_page_info = TRUE,
incl_body = TRUE,
incl_close = TRUE
)
Arguments
- data
The gt table data object
obj:<gt_tbl>
// requiredThis is the gt table object that is commonly created through use of the
gt()
function.- incl_open, incl_close
Include opening/closing braces
scalar<logical>
// default:TRUE
Options that govern whether the opening or closing
"{"
and"}"
should be included. By default, both options areTRUE
.- incl_header
Include RTF header
scalar<logical>
// default:TRUE
Should the RTF header be included in the output? By default, this is
TRUE
.- incl_page_info
Include RTF page information
scalar<logical>
// default:TRUE
Should the RTF output include directives for the document pages? This is
TRUE
by default.- incl_body
Include RTF body
scalar<logical>
// default:TRUE
An option to include the body of RTF document. By default, this is
TRUE
.
Examples
Use a subset of the gtcars
dataset to create a gt table. Add a header
with tab_header()
and then export the table as RTF code using the
as_rtf()
function.
See also
Other table export functions:
as_gtable()
,
as_latex()
,
as_raw_html()
,
as_word()
,
extract_body()
,
extract_cells()
,
extract_summary()
,
gtsave()