upabove
upabove

Reputation: 1119

Extract edges from igraph object

I have an igraph object:

a<-graph.lattice(dimvector = 100, length = NULL, dim = NULL, nei = 5,
              directed = FALSE, mutual = FALSE, circular = TRUE)

I would like to extract the edges from this graph using:

str(a)

and store it in a matrix.

My goal is to keep the format from the output of str().

How can I do this?

Upvotes: 0

Views: 633

Answers (1)

digEmAll
digEmAll

Reputation: 57220

This seems to give the same result as str() :

mx <- do.call(rbind, get.adjlist(a))

Upvotes: 1

Related Questions