R language draws simple circular directed and undirected graphs

library(igraph)
g.1 <- make_graph(c(1, 3, 2, 3, 3, 4, 4, 5))
g.2 <- make_graph(c(2, 1, 3, 1, 4, 1, 5, 1))
g.3 <- make_graph(c(1, 2, 2, 3, 3, 4, 4, 1, 5, 1))
plot(g.1)

insert image description here

plot(g.2)

insert image description here

plot(g.3)

insert image description here

ug <- make_ring(10)
plot(ug)

insert image description here

dg <- make_ring(10, directed = TRUE)
plot(dg)

insert image description here
Reference: "Network Analysis and Visualization" pages 18-19

Guess you like

Origin blog.csdn.net/m0_38127487/article/details/132087973