Reputation: 1238
How is it possible to create a fully undirected graph with 5 nodes?
Using the igraphe package for exampple
library(igraph)
nodes <- c("A", "B", "C", "D", "E")
Upvotes: 0
Views: 241
Reputation: 270268
Use make_full_graph
. Can use label
in place of name
if desired.
g <- make_full_graph(6)
vertex_attr(g, "name") <- head(LETTERS)
plot(g)
or
plot(make_full_graph(6), vertex.name = head(LETTERS)
Upvotes: 2