[英]How do I generate an edge between nodes based on the node attribute values in igraph in R?
[英]How do I simply access the values of an “edge sequence” igraph object?
我想訪問從圖g中的頂點u連接的頂點的ID。
我使用命令E(g)[from(u)]
。 這將產生以下輸出:
Edge sequence:
[9814] 122 -> 24
[9815] 122 -> 178
[9816] 122 -> 124
如何訪問值24、178和124?
我意識到這可能是一個簡單的命令,但是我無法在文檔的任何地方找到如何執行的命令。
也許最簡單的方法是首先使用neighbors()
函數:
neighbors(g, u, mode="out")
如果您真的想從邊緣序列中進行操作,則:
V(g)[ to(E(g)[from(u)]) ]
看到
http://igraph.org/r/doc/structure.info.html
http://igraph.org/r/doc/graph.structure.html
http://igraph.org/r/doc/iterators.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.