Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
頂点の選択に「E(hu)[12]」を使用すると、次の出力が得られます。
[12] A -- B
ここで、これら 2 つの頂点の名前が必要です。名前/ラベル「A」と「B」を選択するにはどうすればよいですか? ありがとう!
頂点セットにインデックスを付けるときに使用inc()して、エッジのインシデント頂点を取得できます。これはおそらく最も読みやすいです:
inc()
# Some example data library(igraph) hu <- graph.ring(20) V(hu)$name <- letters[1:20] V(hu)[ inc(12) ] # Vertex sequence: # [1] "l" "m" V(hu)[ inc(12) ]$name # [1] "l" "m"