---
title: "Untitled"
output: powerpoint_presentation
---
```{r setup, include=FALSE}knitr::opts_chunk$set(echo =假)
## Table
```{r table, echo=FALSE, message=FALSE, warning=FALSE}库(Tidyverse)
库(KableExtra)
mtcars %>%
计数(Cyl) %>%
ungroup() # %>%
kable() %>%
kable_styling()
我正在制作上面的复制品。我想以kable或kableExtra的方式呈现mtcar计算的数据帧,如下所示:

相反,该表以以下控制台格式输出:
## # A tibble: 3 x 2
## cyl n
## <dbl> <int>
## 1 4 11
## 2 6 7
## 3 8 14如何使我的R PowerPoint表在PowerPoint中美观,甚至可以编辑?
发布于 2019-04-16 00:08:30
您可以使用flextable包。它支持R Markdown的powerpoint_presentation输出。您将在下面找到一个示例:
---
title: "Untitled"
output: powerpoint_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Table
```{r table, echo=FALSE, message=FALSE, warning=FALSE}
library(magrittr)
library(flextable)
mtcars[1:5,1:4] %>%
tibble::rownames_to_column() %>%
flextable() %>%
set_header_labels(rowname = "") %>%
add_header_row(values = c("", "Group 1", "Group 2"),
colwidths = c(1, 2, 2)) %>%
theme_zebra() %>% autofit()
```https://stackoverflow.com/questions/55692123
复制相似问题