| bind_networks | R Documentation |
Aligns two networks on node labels and combines their edges.
bind_networks(
x,
y,
method = c("union", "intersection", "difference"),
weight = c("sum", "mean", "max", "min", "first"),
keep_format = FALSE,
directed = NULL
)
x, y |
Network inputs. |
method |
How to combine the edge sets:
|
weight |
How to combine the weights of an edge present in both:
|
keep_format |
Logical. Return |
directed |
Logical or NULL. If NULL (default), the result is directed when either input is. |
A cograph_network over the combined node set, or x's
format when keep_format = TRUE. Nodes are ordered with x's
first, then any node only y has.
add_edges, plot_difference
a <- matrix(0, 3, 3, dimnames = list(c("A", "B", "C"), c("A", "B", "C")))
a["A", "B"] <- a["B", "A"] <- 1
b <- matrix(0, 3, 3, dimnames = list(c("B", "C", "D"), c("B", "C", "D")))
b["B", "C"] <- b["C", "B"] <- 2
bind_networks(a, b)
bind_networks(a, b, method = "difference")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.