repositories安装R包依赖关系

repositories安装R包依赖关系

本文介绍了未从Additional_repositories安装R包依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个程序包,该程序包需要另一个程序包OpenMx的名称空间.该软件包仅可从其自己的存储库中获得,但是在Additional_repositories字段中指定此存储库不起作用.尝试在未安装OpenMx的情况下构建软件包时,我得到:

I am developing a package that requires the namespace of another package, OpenMx. This package is only available from it's own repository, but specifying this repository in the Additional_repositories field does not work. When trying to build my package without OpenMx installed, I get:

错误:依赖项'OpenMx'不可用于此类

ERROR: dependency 'OpenMx' is not available for blah blah

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

Is there a problem with my description, or something else I need to be doing?

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

The relevant piece of my description file:

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仍然是自由格式的字段,不会自动添加到download.packages()所引用的options("repos")中,因此不会自动添加到install.packages()或.

AFAIK Additional_repositories is still a free-form field and not automatically added to the options("repos") consulted by download.packages() and hence install.packages() or update.packages().

对于在CRAN之外添加 repos 的问题,我写了一个小帮手包 drat ,其中包括我在内的一些人用来在GitHub(可通过gh-pages轻松实现的默认"模式)或任何其他可通过HTTP访问的服务器上托管存储库公司或工作组中的本地服务器. Drat并没有做任何特别的困难,但是对于这种默认的添加用户存储库(例如openmx)的情况,您所需要的只是drat::addRepo("openmx"),其余的则是从默认值推断出来的(并假设帐户drat仓库) >存在).

For the very problem of adding repos beyond CRAN, I wrote a little helper package drat which a few people, myself included, use to host repos either on GitHub (a "default" mode as it is so easy via gh-pages) or any other http-accessible server---ie local servers within a company or workgroup. Drat does nothing particularly difficult, but for this default case of adding a repository of user, say, openmx, all you need is drat::addRepo("openmx") and the rest is inferred from defaults (and assumes a drat repo in account openmx exists).

我同时部署了两个用例:通过GitHub上的repos和工作本地的repo来安装较新的软件包.

I deploy both use cases: newer packages via repos at GitHub, and a work-local repo.

但是WRE说

这意味着它看起来在那里.奇怪的.回购在给定的URL上看起来合法.

which implies it looks there. Odd. And the repo looks legit at the given URL.

我在上述报价中向R Core发送了一个拼写错误的补丁.

Edit 2: And I sent a patch to R Core for the typo in the above quote.

这篇关于未从Additional_repositories安装R包依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 15:40