View source: R/network-utils.R
| to_network | R Documentation |
Converts any supported network format to a statnet network object.
to_network(x, directed = NULL)
x |
Network input: matrix, cograph_network, igraph, tna, etc. |
directed |
Logical or NULL. If NULL (default), auto-detect from input. |
A network object from the network package.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.