0
我正在使用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**
我在做什麼錯?