1

I try to knit my rmarkdown file to word and yet, my kable() tables are not shown in the output .docx file? I used the following code:

library(knitr)
library(ggplot2)
library(tidyverse)
library(dplyr)
library(kableExtra)
sub_df%>% kable(col.names = NULL,format="latex", booktabs=TRUE)  %>%
  kable_paper(full_width = F)%>%
  kable_styling(latex_options="scale_down") %>%
  column_spec(1,width = "5in") %>%
      column_spec(2,width = "1in") %>%
      column_spec(3,width = "1in") %>%
      column_spec(4,width = "1in")%>%  
  add_indent(c(2, 3,4))

The results were set ({r, results='asis'})

does anyone have an idea why I cannot see the table in my word file?

Thanks in advance!

macropod
  • 12,757
  • 2
  • 9
  • 21
Leon Nissen
  • 11
  • 1
  • 3

1 Answers1

3

I just answered this question here. Essentially you need to run

options(kableExtra.auto_format = FALSE)

before you load the kableExtra library.

JRB
  • 233
  • 1
  • 9