问题描述
您好,我正在尝试从书中摘录一些示例:使用R 进行子图挖掘的实用图挖掘:
library(subgraphMining)
library(igraph)
graph1 = graph.ring(5)
graph2 = graph.ring(6)
database <- array(dim=2)
database[1] <- list(graph1)
database[2] <- list(graph2)
result <- gspan(database, support= "80%")
出现以下错误:
Error in library(igraph0) : there is no package called ‘igraph0’
这可能是因为igraph0已弃用.因此,我们是否需要调整subgraphMining包中的函数以在R中使用gspan?还是有其他方法可以指出R将igraph0更新为igraph
igraph0
已 not 更新为igraph
,因此您不应该这样做. igraph0
和igraph
之间的主要区别(除了igraph0
已经过时的事实)是igraph0
使用基于0的顶点和边索引,而igraph
使用基于1的索引.简单地使用igraph
代替igraph0
是行不通的,因为依赖于igraph0
expect 顶点索引的软件包从零开始.
唯一明智的解决方案是让仍然依赖igraph0
的软件包的维护者升级到igraph
.或者,您可以从存档中获取igraph0
.. >
Hi am trying some examples from the book: Practical Graph mining with R for subgraph mining:
library(subgraphMining)
library(igraph)
graph1 = graph.ring(5)
graph2 = graph.ring(6)
database <- array(dim=2)
database[1] <- list(graph1)
database[2] <- list(graph2)
result <- gspan(database, support= "80%")
Getting the following error:
Error in library(igraph0) : there is no package called ‘igraph0’
This is probably because igraph0 is deprecated. So, do we need to tweak the functions in the subgraphMining package for using gspan in R; or is there any other way where I can point out to R that igraph0 is updated to igraph
igraph0
is not updated to igraph
so you shouldn't do that. The key difference between igraph0
and igraph
(apart from the fact that igraph0
is way outdated) is that igraph0
uses 0-based vertex and edge indices, while igraph
uses 1-based indices. Simply using igraph
in place of igraph0
won't work because packages depending on igraph0
expect vertex indices to start at zero.
The only sensible solution is to ask the maintainers of packages that still depend on igraph0
to upgrade to igraph
. Alternatively, you can get igraph0
from the archives.
这篇关于不推荐使用igraph0软件包,因此无法访问gspan软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!