View source: R/class-network.R
| is_directed | R Documentation |
Checks whether a cograph_network is directed.
is_directed(x)
x |
A cograph_network object. |
Logical: TRUE if directed, FALSE if undirected.
as_cograph
# Symmetric matrix -> undirected
mat <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
net <- as_cograph(mat)
cograph::is_directed(net) # FALSE
# Asymmetric matrix -> directed
mat2 <- matrix(c(0, 1, 0, 0, 0, 1, 0, 0, 0), nrow = 3)
net2 <- as_cograph(mat2)
cograph::is_directed(net2) # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.