我正试图在我的igraph网络中仅为自循环边缘着色。以下是我的数据样本。
head(network.txt)
From To
A A
A B
A C
A D
B A
B B
B C
B D
C A
C B
C C
C D
D A
D B
D C
D D
这是网络代码
df=read.table("network.txt", header = TRUE)
nodes=unique(df$From)
g=graph_from_data_frame(df)
plot(g, edge.arrow.size=0.2, vertex.color="gold", vertex.size=15, vertex.frame.color="gray", vertex.label.color="black", vertex.label.cex
=0.5, vertex.label.dist=0, edge.curved=0.2, edge.color="black", main="Adult CRC network", layout=layout_in_circle)
和
> head(E(g))
+ 6/16 edges from ea19d0a (vertex names):
[1] A->A A->B A->C A->D B->A B->B
另外,无论如何要将循环保持在网络之外吗?