devtools ::由于小插图构建而检查失败

时间:2016-11-21 18:15:44

标签: r package cran vignette

我正在开发一个包,并考虑在其中加入一个小插图。我使用RStudio进行包开发,并按照Hadley Wickam的说明使用DelimitedDataSchemaRmarkdown或撰写小插图。

我可以在从Rstudio按knitr时编译小插图,但命令knit会返回错误:

devtools::check()

我该怎么做或改变?我知道这只是支票。

会话信息:

==> devtools::check(cleanup = FALSE)

Updating mypackage documentation
Loading mypackage
Setting env vars ---------------------------------------------------------------
CFLAGS  : -Wall -pedantic
CXXFLAGS :-Wall -pedantic
Building mypackage ---------------------------------------------------------------
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file
--no-environ  \   --no-save --no-restore --quiet CMD build  \   '/Volumes/Stockage/Dropbox/R/Packages/mypackage' --no-resave-data  \
--no-manual 

* checking for file ‘/Volumes/Stockage/Dropbox/R/Packages/mypackage/DESCRIPTION’ ... OK
* preparing ‘mypackage’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
* creating vignettes ...
ERROR Error: processing vignette 'mypackage-vignette.Rmd' failed with diagnostics: It seems you should call rmarkdown::render() instead of knitr::knit2html() because mistral-vignette.Rmd appears to be an R Markdown v2 document.
Execution halted
Error: Command failed (1)
In addition: Warning message:
`cleanup` is deprecated
Execution halted

Exited with status 1.

1 个答案:

答案 0 :(得分:5)

好的,在阅读this后解决了这个问题。与Hadley的教程相比,应该在YAML前缀中使用:rmarkdown::render而不是knitr::rmarkdown