-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPowerPoint_Example_2.Rmd
74 lines (54 loc) · 1.48 KB
/
PowerPoint_Example_2.Rmd
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
title: "PowerPoint Example"
author: "Greg Rousell"
date: "13/07/2020"
output:
powerpoint_presentation:
reference_doc: PowerPoint_Template.pptx
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE)
library(flextable)
library(tidyverse)
```
## R Markdown
This is an R Markdown document that knits to a PowerPoint template. Using this feature you can control the appearance of your documents.
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
## Slide with Table
The `flextable` package will format R data frames into tables. For more information on `flextable` see: https://ardata-fr.github.io/flextable-book/index.html
```{r flextable}
summary_table <- iris %>%
group_by (Species) %>%
summarise (`Sepal Length` = round (mean (Sepal.Length),1),
`Sepal Width` = round (mean (Sepal.Width),1)
)
width (summary_table %>% flextable(col_keys = c("Species", "Sepal Length", "Sepal Width")),
j = 1,
width = 1)
```
## Slide with Plot
```{r plot, echo=FALSE}
summary_plot <- summary_table %>%
ggplot (aes(x = Species, y = `Sepal Length`)) +
geom_col (fill = "blue") +
theme_minimal()
summary_plot
```
## Columns
:::::: {.columns}
::: {.column width="40%"}
```{r flextable_2}
width (summary_table %>% flextable(col_keys = c("Species", "Sepal Length", "Sepal Width")),
j = 1,
width = 1)
```
:::
::: {.column width="60%"}
```{r plot_2, echo=FALSE, fig.width=4}
summary_plot
```
:::
::::::