![](/img/trans.png)
[英]Conditionally include a list of child documents in RMarkdown with knitr
[英]Include a chunk in a list RMarkdown
如何将rmarkdown作为列表的一部分包含代码块?
例:
this_fun
最初我使用的是vanilla```代码块,但是它放弃了语法高亮,并且内联放弃了突出显示和换行/缩进。 如果代码如上所述使用,则列表中断,并且块后面的文本嵌入在一个奇怪的环境中(类似于输出格式)。
任何人都知道这是否可以做到?
你在找那个吗? (将以下代码保存为Rmd文件)
---
title: "Untitled"
output: html_document
---
1. Something about some code - you could try this_fun.
1. A more complicated way is to do
```{r, eval = FALSE}
a <- function() { # whole chunk indented by 4!
return(2)
}
print(a())
```
And that may suit your use case
1. Skip it all together
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.