Help on saving GT tables as a word or excel file

Submitting a manuscript, they want submitted tables "editable", meaning in either a word or excel file. Is there a way to save tables (tbl_summary) in that format in markdown or should I just (albeit reluctantly) copy and paste the data in an excel file?

indeed, rmarkdown can knit to word document

Yes, but the table itself is not editable which is what the publisher wants.

try this. It opens for me in word and I can edit the contents:

---
title: "R Notebook"
output: rtf_document
---

```{r echo=FALSE}
library(gt)

example_table <-
  gtcars %>%
  dplyr::select(mfr, model, msrp) %>%
  dplyr::slice(1:5) %>%
  gt() %>%
  tab_header(
    title = md("Data listing from **gtcars**"),
    subtitle = md("`gtcars` is an R dataset")
  ) 
  
```


```{r}
example_table
```

hmmm. also you can install the development version of gt
(i use renv so I do renv::install("rstudio/gt@w-tbl-exp")
then instead of rtf_document you can do word_document and get similar results

I have tried your code nir and two things happen:

  1. With normal gt version it does not create that table in word.
  2. On windows gt dev version throws an error during installation/compilation as this is the case for many packages until windows binaries are developed.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.