Knitr中R降价的全局注释选项 [英] global comment option for R markdown in knitr

查看:74
本文介绍了Knitr中R降价的全局注释选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要更改输出的前导字符,.md中的针织块具有注释选项,例如

To change the leading characters for the output a knitr chunk in .Rmd has a comment option, like

```{r comment = ""}
1:100
```

是否有一种全局设置方式,而不是每个块都单独设置?

Is there a way to set this globally, not separately for every chunk?

opts_knit$set(comment = "")

不起作用,我无法在文档中的任何地方找到它.

does not work and I cannot find it anywhere in the documentation.

推荐答案

使用opts_chunk$set(),因为这是 chunk 选项; opts_knit用于软件包选项(很抱歉,相似的名称似乎使您感到困惑).参见 http://yihui.name/knitr/options

Use opts_chunk$set() because that is a chunk option; opts_knit is for package options (sorry about the similar names which apparently confused you). See http://yihui.name/knitr/options

这篇关于Knitr中R降价的全局注释选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆