Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as_rtf

Output a gt object as RTF


Description

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)

Arguments

data

a table object that is created using the gt() function.

Function ID

13-4

See Also

Other Export Functions: as_latex(), as_raw_html(), extract_summary(), gtsave()

Examples

# Use `gtcars` to create a gt table;
# add a header and then export as
# RTF code
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()

gt

Easily Create Presentation-Ready Display Tables

v0.2.2
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>), Joe Cheng [aut], Barret Schloerke [aut] (<https://orcid.org/0000-0001-9986-114X>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.