R CMD构建跳过了knitr/Rmd小插曲-“在'build/vignette.rds'中列出但不在软件包中的输出" [英] R CMD build skips knitr/Rmd vignettes - "Output(s) listed in 'build/vignette.rds' but not in package"

查看:130
本文介绍了R CMD构建跳过了knitr/Rmd小插曲-“在'build/vignette.rds'中列出但不在软件包中的输出"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为R软件包构建了rmarkdown教程,并希望在构建软件包时包括编译后的文件.尽管文件编译愉快(包括使用R CMD Sweave进行编译时),但我似乎无法将其包含在二进制文件中.

I have built an rmarkdown tutorial for an R package, and would like to include the compiled file when the package is built. Though the file compiles happily (including when I use R CMD Sweave to do so), I don't seem to be able to include it in a binary.

具体地说,当我运行R CMD BUILD时,我得到了

Specifically, when I run R CMD BUILD I get

* checking for file ‘./DESCRIPTION’ ... OK
[snip]
* installing the package to build vignettes
* creating vignettes ... OK
* checking for empty or unneeded directories
Removed empty directory ‘rentrez/inst/doc’
Removed empty directory ‘rentrez/inst’
Removed empty directory ‘rentrez/vignettes/assets’
Removed empty directory ‘rentrez/vignettes’
* building ‘rentrez_0.2.4.tar.gz’

但是在安装此二进制文件并运行vignette(package="rentrez")之后,没有用于该程序包的小插曲.

But after installing this binary and running vignette(package="rentrez") there are no vignettes for the package.

那么,我在做什么错?

So, what am I doing wrong?

如果有帮助,该库的此分支包含小插图和相关的编辑包装. 文件本身位于vignettes/目录中,并以

If it helps, this branch of the library contains the vignettes and associated edits to the package. The file itself is in vignettes/ directory and starts with

<!--
%\VignetteEngine{knitr::knitr}
%\VignetteIndexEntry{rentrez tutorial}
-->

DESCRIPTION 文件包括以下几行

Suggests:
    testthat,-
VignetteBuilder: knitr

编辑

我应该考虑在已构建的程序包上运行R CMD CHECK:

I should have thought to run R CMD CHECK on the built package:

Output(s) listed in 'build/vignette.rds' but not in package:
  ‘inst/doc/rentrez_vignette.html’

据我所知,build/vignette.rds是由R CMD BUILD创建的,但我不知道为什么它指向inst/doc(即使在构建软件包之前就删除了该目录)

As far as I can tell, build/vignette.rds is created by R CMD BUILD, but I don't why it points to inst/doc (even if this dir is deleted before the package is built)

推荐答案

问题是您的.Rbuildignore中有rentrez_*并且与小插图的名称匹配. .Rbuildignore中的行应类似于

The problem is that you have rentrez_* in your .Rbuildignore and that matches the name of your vignette. Lines in .Rbuildignore should look like

^staticdocs$

不是

staticdocs

这篇关于R CMD构建跳过了knitr/Rmd小插曲-“在'build/vignette.rds'中列出但不在软件包中的输出"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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