我正在研究Rmd down报告,根据R变量,我想决定是否包含段落
例如
##Abstract
paragraph Blurb
If result type is 1 then
another paragraph of blurb
Run Code Online (Sandbox Code Playgroud)
我找不到任何简单的方法来做到这一点.我尝试过使用代码块.
例如
```{r echo=FALSE}
if ( resultType1 ) {
cat(c("lines of blurb","more lines of blurb"))
}
```
Run Code Online (Sandbox Code Playgroud)
不幸的是,这会在一个框中输出可选段落,加上与一般抽象段落完全不同的字体,并且确实有一种更好的方法可以做到这一点
怎么样results='asis'在代码块头中使用.
```{r, echo=FALSE, results='asis'}
if ( resultType1 ) {
cat(c("lines of blurb","more lines of blurb"))
}
```
Run Code Online (Sandbox Code Playgroud)
也可以用##等打印标题.
| 归档时间: |
|
| 查看次数: |
382 次 |
| 最近记录: |