0

I'm creating documentation using rmarkdown and Word as output. I'm not able to display correctly tables created using knitr/kable. They are displayed as plain text not table.

RMarkdown code:

---
title: "Untitled"
author: "Supek"
date: "9/9/2019"
output: word_document
always_allow_html: yes
---

```{r}
library(tidyverse)
library(knitr)
library(kableExtra)
data(mtcars)

dt <- mtcars[1:5, 1:6]

kable(dt) %>%
  kable_styling(bootstrap_options = c("striped", "condensed"))

Supek
  • 47
  • 1
  • 7
  • You can output a basic table to Word with `kable(dt, format="markdown")`, but see @novica's answer for other options for more flexable table output in Word. – eipi10 Sep 09 '19 at 08:09

1 Answers1

1

This and this seem to suggest using another R package for getting tables in MSWord.

novica
  • 655
  • 4
  • 11
  • You're right. I have used wrong library. According to this: https://hughjonesd.github.io/huxtable/design-principles.html only huxtable and flextable works with Word output. – Supek Sep 09 '19 at 08:50