I am working on a problem to find the measures related to structure holes in R. The problem is that when I apply the code below to save the adjacency matrix to a variable called "x" (copied from that source) Adjacency matrix in R it gives me an error like:
"Error in as.data.frame.default(d) : cannot coerce class ""igraph"" to a data.frame"
My code and data set looks like this a data frame
s1
uid1 uid2
1 1 2
2 1 3
3 1 4
4 1 5
5 2 3
6 2 4
7 2 5
8 3 4
9 3 5
10 4 5
11 6 7
12 6 8
13 6 9
14 7 8
15 7 9
16 8 9
17 1 6
18 1 7
19 6 7
When I apply this code then the error becomes over here
x <- get.adjacency(graph.data.frame(graph.edgelist(as.matrix(s1), directed=F)))
Error in as.data.frame.default(d) : cannot coerce class ""igraph"" to a data.frame
So any help to use this code for the structure holes measure like
y <- index.egonet(x) #desired output is this code