gpt4 book ai didi

未从 Additional_repositories 安装 R 包依赖项

转载 作者:行者123 更新时间:2023-12-04 09:25:31 27 4
gpt4 key购买 nike

我正在开发一个需要另一个包 OpenMx 的命名空间的包。这个包只能从它自己的存储库中获得,但是在 Additional_repositories 字段中指定这个存储库不起作用。在未安装 OpenMx 的情况下尝试构建我的包时,我得到:

错误:依赖 'OpenMx' 不适用于 blah blah

我的描述有问题,还是我需要做的其他事情?

我的描述文件的相关部分:

Depends: R (>= 3.0.0)
Imports: MASS, OpenMx (>= 2.0)
Additional_repositories: http://openmx.psyc.virginia.edu/OpenMx2/
LazyData: Yes
VignetteBuilder: knitr
Suggests: knitr

从构建尝试中记录:
Thu Apr  2 18:08:10 2015: Building tarball for package ctsem (SVN revision 5)
using R version 3.1.3 Patched (2015-03-16 r67994) ...

* checking for file ‘ctsem/DESCRIPTION’ ... OK
* preparing ‘ctsem’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
-----------------------------------
* installing *source* package ‘ctsem’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘OpenMx’
ERROR: lazy loading failed for package ‘ctsem’
* removing ‘/tmp/RtmpAHPlFq/Rinst5272759a2048/ctsem’
-----------------------------------
ERROR: package installation failed
Run time: 1.09 seconds.

最佳答案

AFAIK Additional_repositories仍然是自由格式字段,不会自动添加到 options("repos")咨询人 download.packages()因此 install.packages()update.packages() .

对于在 CRAN 之外添加 repos 的问题,我写了一个小帮助包 drat包括我在内的一些人使用它在 GitHub(“默认”模式,因为通过 gh-pages 很容易)或任何其他可访问 http 的服务器(即公司或工作组内的本地服务器)上托管存储库。 Drat 没有做任何特别困难的事情,但对于添加用户存储库的默认情况,例如 openmx ,您只需要drat::addRepo("openmx")其余部分是从默认值推断出来的(并假设帐户 drat 中存在 openmx repo )。

我部署了两个用例:通过 GitHub 上的 repos 和工作本地 repo 部署较新的包。

编辑:但 WRE 说

The 'Addiitonal_repositories' field is a comma-separated list of repository URLs where the packages named in the other fields may be found. It is currently used by 'R CMD check' to check that the packages can be found, at least as source packages (which can be installed on any platform).



这意味着它看起来在那里。奇怪的。并且 repo 在给定的 URL 上看起来是合法的。

编辑 2:我向 R Core 发送了一个补丁以解决上述引用中的错字。

关于未从 Additional_repositories 安装 R 包依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29419776/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com