Include non-CRAN package in CRAN package

不羁岁月 提交于 2019-12-01 14:18:27

问题


The question is pretty simple. First:

  1. Is it possible to include a non-CRAN (or bioconductor, or omega hat) package in a CRAN package and actually use tools from that package in examples.
  2. If yes how does one set up the DESCRIPTION file etc. to make it legit and pass CRAN checks?

Specifically I'm asking about openNLPmodels.en that used to be a CRAN package. It's pretty useful and want to include functionality from it. I could do a work around and not actual use openNLPmodels.en in the examples or create unit tests for it, and have it install when a function gets use (similar to how the gender package installs the data sets it needs) but I'd prefer an approach that allows me to run checks, texts, examples.

This is how one downloads and installs openNLPmodels.en

install.packages(
    "http://datacube.wu.ac.at/src/contrib/openNLPmodels.en_1.5-1.tar.gz",  
    repos=NULL, 
    type="source"
)

回答1:


Its possible, but! ...

There is a field in the DESCRIPTION file that that you can use:

Additional_repositories: http://ghrr.github.io/drat

BUT!

Everything that depends on the functionality from the package from the additional repository has to be absolutely optional.

So packages from this repo should be placed under Suggests.

Example

I am not 100% sure whether or not BioConductor and OmegaHat are considered mainstream or not.



来源:https://stackoverflow.com/questions/33335321/include-non-cran-package-in-cran-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!