我正在研究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)
不幸的是,这会在一个框中输出可选段落,加上与一般抽象段落完全不同的字体,并且确实有一种更好的方法可以做到这一点