I have a tibble
like this:
Nodes <- tibble(
Set = c("A","A","A","B","B","C"),
name = c(1,2,3,4,6,5)
)
I want to generate a graph that has Nodes
as nodes
set and
Edges <- tibble(
from = c(1,1,4),
to = c(2,3,6)
)
as edges
. Of course I want to generalize this process for any Nodes
. I think that I can code this with purrr
, but I expect igraph
to be faster and less tricky.
Theoretically, it would be nothing really different than:
Nodes %>% group_as(Set) %>% complete_graph(by = "name")
but I am not sure that a command like complete_graph()
exists. It exists play_islands()
, but it works differently and it assumes that n(Set)
would be fixed.
Try
make_full_graph
fromigraph
which gives