带有大图的as_adjacency_matrix

时间:2016-04-05 21:16:17

标签: r igraph

我有一个包含99927个节点和131698个链接的图表。

我需要将此图转换为邻接矩阵,所以我写道:

g <- make_graph(unlist(sample), directed = FALSE)
print(vcount(g))
print(ecount(g))
m <- as_adjacency_matrix(g, sparse = FALSE)
# find selfloops
num_selfloops <- sum(diag(m)) # this counts each edge in multi-edged self-loop
# find multilinks
num_multilinks <- sum(m > 1) 

但是对于这种规模的网络,我收到了这个错误:

Error in .Call("R_igraph_get_adjacency", graph, as.numeric(type), as.logical(edges),  : 
  At vector.pmt:439 : cannot reserve space for vector, Out of memory 

我使用的是Windows 7,64位和8 GB的RAM。

我该如何解决?

0 个答案:

没有答案