Error in FUN (X [[1L]], ...): input as.edgelist.sna must be adjacency matrix / array, Edgelist matrix, net or sparse matrix or a list of these

I am trying to learn a few basic features in Igraph. But I'm having trouble calculating the powers from a graph: see example below (I copied the following example from this site):

Example dataset:

edges <- matrix (c (103, 86, 24, 103, 103, 2, 92, 103, 87, 103, 103, 101, 103, 44), ncol = 2, byrow = T)

Create graph

g <- graph (as.vector (t (edges)))

I can calculate the degrees around the edges of the matrix: Degree (edges) [1] 378 254 210 390 380 408 294 1230 1084

But I cannot calculate degrees from graph g:

degree (g)

I am getting the following error:

Error in FUN (X [[1L]], ...): Input as.edgelist.sna must be adjacency matrix / array, Edgelist matrix, net or sparse matrix or its list.

Does anyone know why I am getting this error?

+3


source to share


1 answer


I faced the same problem. This worked for me:



net <- make_ring(10)
deg <- centralization.degree(net)$res

      

+1


source







All Articles