C. *_*ill 4 r knitr r-markdown
如何将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
Run Code Online (Sandbox Code Playgroud)