Converts any supported network format to a statnet network object.
Usage
to_network(x, directed = NULL)
Arguments
- x
Network input: matrix, cograph_network, igraph, tna, etc.
- directed
Logical or NULL. If NULL (default), auto-detect from input.
Value
A network object from the network package.
Examples
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)
}