如何将一个图中的边添加到R中的另一个图中?
问题描述:
我正在使用R(v3.4.1)。 我有一个graphml文件的图形:如何将一个图中的边添加到R中的另一个图中?
g <-read.graph(file = "./proteinLC.graphml",format = "graphml")
我需要从图G节点的10%,并把它们绘制米 我试图做这样的事情:
m <- add_edges(g, c(sample(1:length(E(g)), length(E(g))*0.1, replace = F)))
但我得到一个错误:
Error: At type_indexededgelist.c:272 : cannot add edges, Invalid vertex id**
我在做什么错?