library(igraph)
g <- sample_gnp(10, 0.4)
if (FALSE) {
library(ggraph)
ggraph(g, layout = "centrality", centrality = closeness(g)) +
draw_circle(use = "cent") +
annotate_circle(closeness(g), pos = "bottom", format = "scientific") +
geom_edge_link() +
geom_node_point(shape = 21, fill = "grey25", size = 5) +
theme_graph() +
coord_fixed()
}
Run the code above in your browser using DataLab