包括未在Rpresentation Markdown中运行的代码

时间:2014-04-30 13:32:37

标签: r markdown presentation

我在RStudio中有一个.Rpres文件。我想包含代码,但没有运行(我只显示代码来解释它是如何工作的)。是否有可能实现这一点(并确保它不会产生错误,因为它没有运行)?

2 个答案:

答案 0 :(得分:83)

您是否在eval=FALSE代码块选项中尝试了knitr? e.g:

```{r eval=FALSE}
print("Don't run me")
```

答案 1 :(得分:13)

<resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <includes> <include>**/*.java</include> <include>**/*.xml</include> <include>**/*.properties</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> <excludes> <exclude>**/*.java</exclude> <exclude>**/*.xml</exclude> <exclude>**/*.properties</exclude> </excludes> </resource> </resources> 将在未评估的输出文件中包含R源代码