powered by
Converts any supported network format to a statnet network object.
to_network(x, directed = NULL)
A network object from the network package.
Network input: matrix, cograph_network, igraph, tna, etc.
Logical or NULL. If NULL (default), auto-detect from input.
to_igraph, to_matrix, to_df, as_cograph
to_igraph
to_matrix
to_df
as_cograph
if (requireNamespace("network", quietly = TRUE)) { adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3, 3) rownames(adj) <- colnames(adj) <- c("A", "B", "C") net <- to_network(adj) }
Run the code above in your browser using DataLab