使用 RStudio 和 Rmarkdown 时,我无法生成横向文档。
R 是版本 3.4.2
RStudio 是版本 0.98.1103
我无法更改这些,因为它们是我运行程序的集群上的最新版本。
编织文件后,我确实得到了一个文件(以纵向形式),但是收到以下错误消息:
Output created: test_landscape.docx
Warning message:
In (function (toc = FALSE, toc_depth = 3, fig_width = 5, fig_height = 4, :
table of contents for word_document requires pandoc >= 1.14
可重现的代码在这里:
---
title: "test_landscape"
author: "Name"
date: "09/10/2018"
output: word_document
classoption: landscape
---
Test for landscape orientation
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
不确定这是否更适合交叉验证,因为 R 是一种统计编程语言,但问题不是统计语言。
谢谢你。
编辑:在下面的评论后编辑标题以更好地代表我的问题。
最佳答案
感谢拉尔夫·斯图纳。
对于如何在此处专门针对 word 执行此操作的过程,有一个很好的解释:https://rmarkdown.rstudio.com/articles_docx.html
您必须创建一个具有所需设置(例如横向)的 Word 文档,将其保存在与 .Rmd 文件相同的位置,然后将其作为引用文档引用,例如:
---
title: "test_landscape"
author: "Name"
date: "09/10/2018"
output:
word_document:
reference_docx: word_styles.docx
---
关于r-markdown - 使用 classoption : landscape 时无法从 R markdown 生成横向的 microsoft word 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52719576/