我对 igraph 包做了一个小改动,想安装这个改动过的包。但是我之前已经在电脑中安装了 raw 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?
Run Code Online (Sandbox Code Playgroud)
小智 5
该igraph软件包包含 C 和其他非 R 代码。此代码要么在安装时编译(如果您在 Linux 上),要么从 CRAN(Mac 和 Windows)下载预编译的二进制文件。这些 C 和 C++ 函数通过.Call. R 函数.Call将包名称作为参数包含在内igraph。所以发生的情况是你加载 tryigraphmy并且它失败了,因为它无法在igraph包中找到它想要的函数,因为igraph它不是一个现有的包。尝试加载igraph,然后igraphmy或编辑DESCRIPTION说,igraphmy取决于igraph使用的语法igraphmy::foo使用igraphmy函数的版本,并igraph::foo为igraphverison。