as_rtf | R Documentation |
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.
as_rtf(
data,
incl_open = TRUE,
incl_header = TRUE,
incl_page_info = TRUE,
incl_body = TRUE,
incl_close = TRUE
)
data |
The gt table data object
This is the gt table object that is commonly created through use of the
|
incl_open , incl_close |
Include opening/closing braces
Options that govern whether the opening or closing |
incl_header |
Include RTF header
Should the RTF header be included in the output? By default, this is
|
incl_page_info |
Include RTF page information
Should the RTF output include directives for the document pages? This is
|
incl_body |
Include RTF body
An option to include the body of RTF document. By default, this is |
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.
tab_rtf <- gtcars |> dplyr::select(mfr, model) |> dplyr::slice(1:2) |> gt() |> tab_header( title = md("Data listing from **gtcars**"), subtitle = md("`gtcars` is an R dataset") ) |> as_rtf()
13-4
v0.2.0.5
(March 31, 2020)
Other table export functions:
as_gtable()
,
as_latex()
,
as_raw_html()
,
as_word()
,
extract_body()
,
extract_cells()
,
extract_summary()
,
gtsave()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.