2016-11-21 23 views
4

我正在開發一個軟件包,並考慮在其中包含一個小插曲。我使用RStudio進行包裝開發,並按照Hadley Wickam的說明使用Rmarkdownknitr或編寫小插圖。devtools ::檢查失敗,因爲小插曲建設

按從Rstudio 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. 

我應該怎麼做或改變?我知道這只是支票。

會議信息:

> 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  

回答

3

好得到了閱讀this後固定。與哈德利的教程相比,應該在YAML preambule中使用:rmarkdown::render而不是knitr::rmarkdown