remove_isolates: Remove Isolated Nodes

View source: R/wrangle-structure.R

remove_isolatesR Documentation

Remove Isolated Nodes

Description

Removes every node with no edges. Edge filters such as filter_edges keep all nodes, and this function removes the isolates that such a filter leaves behind.

Usage

remove_isolates(x, keep_format = FALSE, directed = NULL)

Arguments

x

Network input: cograph_network, matrix, igraph, network, tna, or an edge-list data frame.

keep_format

Logical. If TRUE, a matrix, igraph, statnet network or tna input is returned in its own format. An edge-list data frame or a qgraph object is returned as a cograph_network with a cograph_no_format_roundtrip warning. Default FALSE returns a cograph_network.

directed

Logical or NULL. Directedness used to read the input. NULL (default) detects it from the input.

Value

A cograph_network with the isolated nodes removed (or the input format when keep_format = TRUE). The remaining nodes keep their order, and edge indices are remapped to the new node numbering.

See Also

filter_edges, split_components, filter_nodes

Examples

remove_isolates(threshold_edges(regulation_net, minimum = 0.3))

cograph documentation built on Nov. 19, 2026, 5:07 p.m.