View source: R/network-utils.R
| select_edges | R Documentation |
Selects edges by filter expressions, by node sets, by rank on a metric, or by structural properties such as bridges, communities and reciprocity.
select_edges(
x,
...,
top = NULL,
by = "weight",
involving = NULL,
between = NULL,
bridges_only = FALSE,
mutual_only = FALSE,
community = "louvain",
keep_isolates = TRUE,
keep_format = FALSE,
directed = NULL,
.keep_isolates = NULL
)
x |
Network input: cograph_network, matrix, igraph, network, or tna object. |
... |
Filter expressions using edge columns or computed metrics. Available variables:
|
top |
Integer. Select top N edges by a metric. |
by |
Character. Metric for top selection. Default |
involving |
Character or integer. Select edges involving these nodes (by name or index). An edge is selected if either endpoint matches. |
between |
List of two character/integer vectors. Select edges between
two node sets. Example: |
bridges_only |
Logical. Select only bridge edges (edges whose removal disconnects the graph). Default FALSE. |
mutual_only |
Logical. For directed networks, select only mutual (reciprocated) edges. Default FALSE. |
community |
Character. Community detection method for |
keep_isolates |
Logical. Keep nodes that end up with no edges?
Default TRUE, matching |
keep_format |
Logical. If TRUE, matrix, igraph, statnet network and tna inputs are returned in that format. Default FALSE returns cograph_network. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
.keep_isolates |
Deprecated. Use |
Selection criteria are combined with AND logic, so an edge is selected only
when it satisfies all of them. The top ranking is applied to the
edges that pass involving, between, bridges_only and
mutual_only, and the filter expressions in ... are applied
afterwards. For example, select_edges(x, top = 10, involving = "A")
selects the 10 strongest edges among those involving node A.
Only the edge metrics referenced in expressions or required by a selection criterion are computed.
A cograph_network object with selected edges. If keep_format = TRUE,
matrix, igraph, statnet network and tna inputs are converted back to that type.
Nodes left without edges are kept and reported in a
cograph_isolates_created warning, unless
keep_isolates = FALSE.
filter_edges, select_nodes,
select_bridges, select_top_edges
select_edges(regulation_net, top = 5, keep_isolates = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.