带有knitr :: rmarkdown_notangle的未评估小插曲 [英] non-evaluated vignettes with knitr::rmarkdown_notangle
问题描述
knitr
软件包相对较新地添加了新的notangle
小插图引擎,例如knitr::rmarkdown_notangle
,这些引擎允许禁用小插图块的评估.在此处中描述了使用knitr
进行小插曲的一般过程,而具体的
<!--
%\VignetteEngine{knitr::rmarkdown_notangle}
%\VignetteIndexEntry{Supplementary Materials}
-->
A silly little vignette.
```{r}
2+2
```
我的DESCRIPTION
文件包括
Suggests:
knitr,
VignetteBuilder: knitr
BuildVignettes: yes
当我尝试运行R CMD check
时,我会得到
* checking re-building of vignette outputs ... NOTE
Error in re-building vignettes:
...
Error: processing vignette 'notangle.rmd' failed with diagnostics:
Failed to locate the ‘weave’ output file (by engine ‘knitr::rmarkdown_notangle’)
for vignette with name ‘notangle’. The following files exist in directory ‘.’:
‘notangle.rmd’
使用r-devel(2014-09-17 r66626),但在3.1.1中也会发生这种情况.
解决方法(我强烈希望避免)是将R代码块切换为通用代码块(使用三重反引号而不是三重反引号+"r"打开),而Rmarkdown不会处理. /p>
我确定我在做些蠢事.有任何线索吗?
更新:我可以通过将eval=FALSE
显式添加到每个块的选项中来获得所需的信息(阻止对所有块进行评估),但我仍然想知道发生了什么...
这是knitr当前版本中的一个错误,已经开发版本 1.7.9中,该版本(希望是在CRAN上为v1.8)将来.
The knitr
package has relatively recently added new notangle
vignette engines, such as knitr::rmarkdown_notangle
, that allow disabling of evaluation of vignette chunks. The general process of using knitr
for vignettes is described here, while the specific notangle
functionality is described in an answer to this question.
My problem is that I can't get this to work. I can get it to pass R CMD build
by including the .html
output in the vignettes
directory (I also put a copy in inst/doc
), but I can't get it to pass R CMD check
unless I specify --no-build-vignettes
, or unless I change the rmarkdown_notangle
engine back to rmarkdown
.
I have built a trivial package that contains the following vignette (in vignettes/notangle.rmd
): it's available here.
<!--
%\VignetteEngine{knitr::rmarkdown_notangle}
%\VignetteIndexEntry{Supplementary Materials}
-->
A silly little vignette.
```{r}
2+2
```
My DESCRIPTION
file includes
Suggests:
knitr,
VignetteBuilder: knitr
BuildVignettes: yes
When I try to run R CMD check
I get
* checking re-building of vignette outputs ... NOTE
Error in re-building vignettes:
...
Error: processing vignette 'notangle.rmd' failed with diagnostics:
Failed to locate the ‘weave’ output file (by engine ‘knitr::rmarkdown_notangle’)
for vignette with name ‘notangle’. The following files exist in directory ‘.’:
‘notangle.rmd’
Using r-devel (2014-09-17 r66626), but also happens with 3.1.1.
The workaround (which I would strongly prefer to avoid) is to switch from R code chunks to generic code chunks (opens with triple-backtick, rather than triple-backtick+"r"), which Rmarkdown doesn't process.
I'm sure I'm doing something boneheaded. Any clues?
update: I can get what I need (stop all chunks from being evaluated) by explicitly adding eval=FALSE
to the options of every chunk, but I'd still like to know what's going on ...
It is a bug in the current version of knitr, and it has been fixed in the development version 1.7.9, which will (hopefully) be v1.8 on CRAN in the future.
这篇关于带有knitr :: rmarkdown_notangle的未评估小插曲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!