Closed SimonMontfort closed 1 week ago
I want to compute the connected components of a two-mode network.
library(manynet) nw12 <- network.initialize(20, dir = FALSE, bipartite = 5) set.seed(1) nw12[,] <- sample(c(1, 0), 20, replace = TRUE) g <- as_igraph(nw12) V(g)$type <- c(rep("actor", 5), rep("event", 15)) net_components(g)
produces the error
Error in !igraph::V(.data)$type : invalid argument type
when I transform to logical it works
V(g)$type <- V(g)$type == "actor" net_components(g) [1] 1
$type is a reserved variable that expects the format to be logical. This is due to how {igraph} processes bipartite/twomode networks.
$type
{igraph}
I want to compute the connected components of a two-mode network.
produces the error
when I transform to logical it works