select_edges_involving: Select Edges Involving Nodes

View source: R/network-utils.R

select_edges_involvingR Documentation

Select Edges Involving Nodes

Description

Select edges where at least one endpoint is in the specified node set.

Usage

select_edges_involving(
  x,
  nodes,
  ...,
  .keep_isolates = FALSE,
  keep_format = FALSE,
  directed = NULL
)

Arguments

x

Network input.

nodes

Character or integer. Node 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.

Value

A cograph_network with edges involving the specified nodes.

See Also

select_edges, select_edges_between

Examples

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 involving A
select_edges_involving(adj, nodes = "A")

# Edges involving A or B
select_edges_involving(adj, nodes = c("A", "B"))

cograph documentation built on April 1, 2026, 1:07 a.m.