我正在使用R(v3.4.1)。 我有一个graphml的graphml文件:
g <-read.graph(file = "./proteinLC.graphml",format = "graphml")
我需要从图g获得10%的节点并将它们放到图m中。 我试着做这样的事情:
m <- add_edges(g, c(sample(1:length(E(g)), length(E(g))*0.1, replace = F)))
但是我收到了一个错误:
错误:在type_indexededgelist.c:272:无法添加边,无效的顶点id **
我做错了什么?