-
Notifications
You must be signed in to change notification settings - Fork 218
Closed
Description
Currently, we can only use the rtf_document format in R Markdown to generate a Word compatible document with gt tables embedded within.
Here is a minimal example:
---
output: rtf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(gt)
```
# gt Table in RTF document
```{r}
gtcars %>%
dplyr::filter(ctry_origin == "Germany") %>%
dplyr::group_by(mfr) %>%
dplyr::top_n(2, msrp) %>%
dplyr::ungroup() %>%
dplyr::select(mfr, model, drivetrain, msrp) %>%
gt()
```
Which produces this document:
The problem is that the word_document output format for R Markdown doesn't work in this way. Other packages that create display tables haven't yet solved this problem either. Proposal here is to generate a as_word() function to create table output that is compatible with the Word document output that R Markdown generates.
simonthelwall, sfirke, andresrcs, 1danjordan, karissawhiting and 12 more
