简体   繁体   English

如何使用R.rsp在R包中包含静态小插图

[英]How to include static Vignettes in R Package using R.rsp

I would like to include static vignettes in my R package that will show up for users using the R function browseVignettes() . 我想在我的R包中包含静态晕影,它将显示给使用R函数browseVignettes()

I need the vignettes to be static because the vignettes take too long to build, causing me to fail CRAN checks on win-builder if they are included dynamically. 我需要将小插图设置为静态,因为小插图构建时间太长,如果动态包含它们,会导致我对win-builder的CRAN检查失败。

The package R.rsp seems to provide exactly what I want; R.rsp似乎提供了我想要的东西; described here: https://cran.r-project.org/web/packages/R.rsp/vignettes/R_packages-Static_PDF_and_HTML_vignettes.pdf . 这里描述: https//cran.r-project.org/web/packages/R.rsp/vignettes/R_packages-Static_PDF_and_HTML_vignettes.pdf

I followed the instructions from R.rsp . 我按照R.rsp的指示R.rsp I have a vignettes folder that contains a .html file with a corresponding .Rmd file and a .html.asis file, as directed. 我有一个vignettes文件夹,其中包含一个.html文件,其中包含相应的.Rmd文件和.html.asis文件。 I also have the appropriate code in the DESCRIPTION file. 我还在DESCRIPTION文件中有相应的代码。 With these settings, I pass CRAN tests on win-builder, travis, etc. However, when I download the package from github, it says that there are no vignettes associated with the package. 通过这些设置,我在win-builder,travis等上传递CRAN测试。但是,当我从github下载软件包时,它表示没有与软件包相关的小插图。 Am I missing something about the R.rsp package? 我错过了关于R.rsp包裹的一些信息吗? Is this capability outdated? 这种能力已经过时了吗? Do I need to copy the built vignettes from the Vignettes folder into an inst/doc folder? 我是否需要将构建的晕影从Vignettes文件夹复制到inst / doc文件夹中? (I have seen conflicting information about vignettes folder vs inst/doc folder). (我看到有关vignettes文件夹vs inst / doc文件夹的冲突信息)。

Is using something like R.rsp::asis the best way to include vignettes that take too long to build to include dynamically? 使用像R.rsp :: asis这样的东西是最好的方法来包含动态构建需要太长时间才能动态包含的小插图吗? Another method that I have seen is to include the vignettes folder in .Rbuildignore, and then include a note in the README file telling users that they can build the vignettes separately from github in order to view them. 我看到的另一种方法是在.Rbuildignore中包含vignettes文件夹,然后在README文件中包含一个注释,告诉用户他们可以与github分开构建动画片以便查看它们。 I am also considering including links in the README to external vignettes. 我也在考虑将README中的链接包含在外部插图中。 Is this a better approach? 这是一种更好的方法吗? Which might CRAN prefer? 哪个可能CRAN更喜欢?

build_vignettes=TRUE添加到install_github调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM