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

Cle*_*ter 4 vignette r package cran

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

我可以在knit从Rstudio 按下时编译小插图,但该命令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.
Run Code Online (Sandbox Code Playgroud)

我该怎么做或改变?我知道这只是检查.

会话信息:

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_2.1.0     foreach_1.4.3     knitr_1.14        rmarkdown_1.2    
[5] mistral_2.2.1    
Run Code Online (Sandbox Code Playgroud)

Cle*_*ter 5

好吧得到看完后固定.与Hadley的教程相比,应该使用:rmarkdown::render而不是knitr::rmarkdown在YAML前言中.