View source: R/wrangle-structure.R
| complement_network | R Documentation |
Every pair of distinct nodes that is not joined in x is joined in the
complement, and vice versa.
complement_network(
x,
weight = 1,
loops = FALSE,
keep_format = FALSE,
directed = NULL
)
x |
Network input. |
weight |
Numeric. Weight to give the new edges. Default 1. Zero is how
this representation stores "no edge", so |
loops |
Logical. Include self-loops in the complement. Default FALSE. |
keep_format |
Logical. Return the input format when TRUE. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
A cograph_network holding the complement, or the input format
when keep_format = TRUE. Directedness is preserved.
to_undirected, binarize
adj <- matrix(c(0, 1, 0,
1, 0, 0,
0, 0, 0), 3, 3)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")
complement_network(adj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.