R markdown pdf,一些输出不会显示
R markdown pdf, some output won't show
所以我决定将我的 html R markdown 文件转换为 pdf knitr,我注意到一半的代码输出不会显示。我在这里复制了一个小例子:
---
title: "Test"
author: "Brandon Morgan"
date: "1/19/2021"
output:
pdf_document:
df_print: paged
fig_caption: yes
fig_height: 6
fig_width: 7
highlight: tango
toc: yes
toc_depth: 4
html_document:
code_folding: hide
csl: biomed-central.csl
fig_caption: yes
fig_height: 6
number_sections: yes
theme: sandstone
toc: yes
toc_float: yes
---
# TEST
## Data
```{r}
data = iris
head(data)
```
这是我的 html knitr 输出:
这是我的 pdf knitr 输出:
请注意 head(data)
如何不显示 pdf 输出
快速修复:删除 df_print: paged
。我现在不能告诉你为什么它不会产生你想要的结果。
---
title: "Test"
author: "Brandon Morgan"
date: "1/19/2021"
output:
pdf_document:
fig_caption: yes
fig_height: 6
fig_width: 7
toc: yes
toc_depth: 4
html_document:
code_folding: hide
csl: biomed-central.csl
fig_caption: yes
fig_height: 6
number_sections: yes
theme: sandstone
toc: yes
toc_float: yes
---
# TEST
## Data
```{r echo=FALSE, results=TRUE}
data = iris
head(data)
```
所以我决定将我的 html R markdown 文件转换为 pdf knitr,我注意到一半的代码输出不会显示。我在这里复制了一个小例子:
---
title: "Test"
author: "Brandon Morgan"
date: "1/19/2021"
output:
pdf_document:
df_print: paged
fig_caption: yes
fig_height: 6
fig_width: 7
highlight: tango
toc: yes
toc_depth: 4
html_document:
code_folding: hide
csl: biomed-central.csl
fig_caption: yes
fig_height: 6
number_sections: yes
theme: sandstone
toc: yes
toc_float: yes
---
# TEST
## Data
```{r}
data = iris
head(data)
```
这是我的 html knitr 输出:
这是我的 pdf knitr 输出:
请注意 head(data)
如何不显示 pdf 输出
快速修复:删除 df_print: paged
。我现在不能告诉你为什么它不会产生你想要的结果。
---
title: "Test"
author: "Brandon Morgan"
date: "1/19/2021"
output:
pdf_document:
fig_caption: yes
fig_height: 6
fig_width: 7
toc: yes
toc_depth: 4
html_document:
code_folding: hide
csl: biomed-central.csl
fig_caption: yes
fig_height: 6
number_sections: yes
theme: sandstone
toc: yes
toc_float: yes
---
# TEST
## Data
```{r echo=FALSE, results=TRUE}
data = iris
head(data)
```