【发布时间】:2022-12-01 21:50:21
【问题描述】:
I want to plot an undirected strongly connected graph like the uploaded picture.
I want to use the adjacency matrix in order to plot it.
I tried the igraph package in R :
data <- matrix(c(0,1,0,0,1,
1,0,1,0,0,
0,1,0,1,0,
0,0,1,0,1,
1,0,0,1,0),nrow=5,ncol = 5)
colnames(data) = rownames(data) = LETTERS[1:5]
data
network <- graph_from_adjacency_matrix(data)
plot(network)
But it creates a cycle.
Any help ?
【问题讨论】:
标签: r graph adjacency-matrix