2013-04-29 211 views
3

查看圖形對象作爲邊界列表時,是否有任何方式顯示邊緣權重?R/Igraph顯示邊緣列表中的邊緣權重?

我想要做的事在精神:

get.edgelist(graph, attr='weight') 

,以便查看與節點旁邊列出的砝碼邊緣配對,但似乎並沒有被允許的。只有我知道如何查看權重才能將網絡數據視爲鄰接矩陣。希望這不是唯一的方法。

回答

10

在pkg使用示例中的幫助頁面功能get.edgelist:IGRAPH:

> cbind(get.edgelist(g) , round(E(g)$weight, 3)) 
     [,1] [,2] [,3] 
[1,] "a" "b" "0.342" 
[2,] "b" "d" "0.181" 
[3,] "b" "e" "0.403" 
[4,] "b" "f" "0.841" 
[5,] "d" "f" "0.997" 
[6,] "e" "g" "0.029" 
[7,] "a" "h" "0.17" 
[8,] "b" "j" "0.69" 
[9,] "g" "j" "0.422"