在构建新包时,如何使用不在常规存储库中的依赖包?

时间:2021-10-07 23:09:07

My package depends on another package which is not uploaded in cran, mran or even github and it has a .zip format. When submitting my package on cran it can't find the package and returns errors. How can I use the not uploaded package on public repositories, in a package that want to be submitted on cran?

我的包取决于另一个没有上传到cran,mran甚至github的包,它有.zip格式。在cran上提交我的包时,它无法找到包并返回错误。如何在想要在cran上提交的包中的公共存储库上使用未上载的包?

1 个解决方案

#1


4  

Some ideas:

  1. Ask the authors of the original package to submit it to CRAN.
  2. 请原始包的作者将其提交给CRAN。

  3. If the package is open source, add it into your package and attribute the original authors (should probably add them as authors on the combined package; also would be a good idea to contact them first)
  4. 如果包是开源的,请将其添加到您的包中并将原始作者归属(可能应该将它们作为作者添加到组合包中;也最好先与他们联系)

  5. Create a drat repository for the dependent package and then add this repository in the field Additional_repositories in the DESCRIPTION file
  6. 为依赖包创建drat存储库,然后在DESCRIPTION文件的Additional_repositories字段中添加此存储库

The 3rd option is the only purely technical solution. See the drat documentation, this SO answer from the drat package author, and this thread on R-pkg-devel in which an R package author successfully submits to CRAN following this strategy.

第三种选择是唯一的纯技术解决方案。请参阅drat文档,这是来自drat包作者的回答,以及R-pkg-devel上的这个帖子,其中R包作者成功地遵循此策略提交给CRAN。

Update: The CRAN package discussed above that used option 3 was wikipediatrend. This line in the DESCRIPTION file sets the Additional_repositories field.

更新:上面讨论的使用选项3的CRAN包是wikipediatrend。 DESCRIPTION文件中的这一行设置Additional_repositories字段。

#1


4  

Some ideas:

  1. Ask the authors of the original package to submit it to CRAN.
  2. 请原始包的作者将其提交给CRAN。

  3. If the package is open source, add it into your package and attribute the original authors (should probably add them as authors on the combined package; also would be a good idea to contact them first)
  4. 如果包是开源的,请将其添加到您的包中并将原始作者归属(可能应该将它们作为作者添加到组合包中;也最好先与他们联系)

  5. Create a drat repository for the dependent package and then add this repository in the field Additional_repositories in the DESCRIPTION file
  6. 为依赖包创建drat存储库,然后在DESCRIPTION文件的Additional_repositories字段中添加此存储库

The 3rd option is the only purely technical solution. See the drat documentation, this SO answer from the drat package author, and this thread on R-pkg-devel in which an R package author successfully submits to CRAN following this strategy.

第三种选择是唯一的纯技术解决方案。请参阅drat文档,这是来自drat包作者的回答,以及R-pkg-devel上的这个帖子,其中R包作者成功地遵循此策略提交给CRAN。

Update: The CRAN package discussed above that used option 3 was wikipediatrend. This line in the DESCRIPTION file sets the Additional_repositories field.

更新:上面讨论的使用选项3的CRAN包是wikipediatrend。 DESCRIPTION文件中的这一行设置Additional_repositories字段。