我正在开发一个包,并考虑在其中加入一个小插图。我使用RStudio进行包开发,并按照Hadley Wickam的说明使用DelimitedDataSchema
和Rmarkdown
或撰写小插图。
我可以在从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.
答案 0 :(得分:5)
好的,在阅读this后解决了这个问题。与Hadley的教程相比,应该在YAML前缀中使用:rmarkdown::render
而不是knitr::rmarkdown
。