-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknitToWord.Rmd
More file actions
46 lines (31 loc) · 752 Bytes
/
knitToWord.Rmd
File metadata and controls
46 lines (31 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: "Kniting to Word"
author: '@dataknut'
date: "17/09/2019"
output: word_document
always_allow_html: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Knitting to MS Word
...does not always go according to plan...
This is a table which we'd like as a prettified `kableExtra::` table...
```{r testKableExtra}
df <- mtcars
library(kableExtra)
kableExtra::kable(df, caption = "mtcars table") %>%
kable_styling()
```
But we can use
* library(flextable)
* library(officer)
See https://cran.r-project.org/web/packages/flextable/vignettes/overview.html
```{r testKableExtra}
library(flextable)
library(officer)
myft <- flextable(
head(df),
col_keys = c("am", "carb", "gear", "mpg", "drat" ))
myft
```