View source: R/network-utils.R
| select_edges_between | R Documentation |
Select edges connecting two specified node sets.
select_edges_between(
x,
set1,
set2,
...,
.keep_isolates = FALSE,
keep_format = FALSE,
directed = NULL
)
x |
Network input. |
set1 |
Character or integer. First node set (names or indices). |
set2 |
Character or integer. Second node set (names or indices). |
... |
Additional filter expressions. |
.keep_isolates |
Keep nodes with no edges? Default FALSE. |
keep_format |
Keep input format? Default FALSE. |
directed |
Auto-detect if NULL. |
A cograph_network with edges between the two node sets.
select_edges, select_edges_involving
adj <- matrix(c(0, .5, .8, 0,
.5, 0, .3, .6,
.8, .3, 0, .4,
0, .6, .4, 0), 4, 4, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D")
# Edges between {A, B} and {C, D}
select_edges_between(adj, set1 = c("A", "B"), set2 = c("C", "D"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.