首页 > 解决方案 > R Markdown - 不要在 HTML 输出中显示文本

问题描述

有没有办法在 R 标记输出到 HTML 时不显示“文本”(不是代码)?例如:

```{r, echo=False}
I want the output of this R Code
```

这是介绍 .Rmd 文件中下一部分的文本。但是,我不希望它出现在我的 .HTML 文件中。

```{r, echo=False}
Next section of R code to display
```

标签: rr-markdown

解决方案


无论您不想在输出中显示什么,请将其放在 <!--- blabla --> 之间

例如:

```{r, echo=FALSE}
I want the output of this R Code```

<!---
This is text to introduce the next section in the .Rmd file. I, however, do NOT want this to appear in my .HTML file.
-->

```{r, echo=FALSE}
Next section of R code to display```

推荐阅读