如何更改R的包名称

时间:2014-03-26 06:17:43

标签: r

我对igraph包进行了一些小改动,想要安装这个更改过的包。但我之前已经在计算机上安装了原始igraph包。这两个包具有相同的名称。

我尝试将描述文件中的名称从 igraph 更改为 igraphmy 。但它没有用。如错误所示:

Error : .onLoad failed in loadNamespace() for 'igraphmy', details:
  call: library.dynam("igraph", pkgname, libname, local = FALSE)
  error: DLL 'igraph' not found: maybe not installed for this architecture?

1 个答案:

答案 0 :(得分:4)

igraph包中包含C和其他非R代码。当您进行安装或从CRAN(Mac和Windows)下载预编译的二进制文件时,此代码要么编译(如果您在Linux上)。这些C和C ++函数通过.Call与R连接。 R函数.Call包括包名igraph作为参数。那么当你加载试试igraphmy时会发生什么情况并且失败,因为它无法在igraph包中找到它想要的函数,因为igraph不是现有的包。尝试加载igraph然后加载igraphmy或修改DESCRIPTION以说明igraphmy取决于igraph并使用语法igraphmy::foo来使用{ {1}}函数的版本和igraphmy版本的igraph::foo