reachability <- function(g, m) {
reach_mat = matrix(nrow = vcount(g),
ncol = vcount(g))
for (i in 1:vcount(g)) {
reach_mat[i,] = 0
this_node_reach <- subcomponent(g, (i - 1), mode = m)
for (j in 1:(length(this_node_reach))) {
alter = this_node_reach[j] + 1
reach_mat[i, alter] = 1
}
}
return(reach_mat)
}
`reach_full_in <- reachability(krack_full, 'in')
Error in .Call("R_igraph_subcomponent", graph, as.igraph.vs(graph, v) - :
At structural_properties.c:1244 : subcomponent failed, Invalid vertex id