split_components: Split a Network into Its Connected Components

View source: R/wrangle-structure.R

split_componentsR Documentation

Split a Network into Its Connected Components

Description

Split a Network into Its Connected Components

Usage

split_components(x, min_size = 1L, keep_format = FALSE, directed = NULL)

Arguments

x

Network input.

min_size

Integer. Components with fewer nodes are dropped. Default 1 keeps every component, including isolated nodes.

keep_format

Logical. If TRUE, each component of a matrix, igraph, statnet network or tna input is returned in that format. An edge-list data frame or a qgraph object gives cograph_network components with a cograph_no_format_roundtrip warning. Default FALSE.

directed

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

Value

A list of cograph_network objects, one per component, ordered from largest to smallest and named "component_1", "component_2", and so on. Components are weakly connected, matching igraph::components(mode = "weak"). A network with no nodes gives an empty list and a warning.

See Also

select_component, remove_isolates

Examples

split_components(threshold_edges(regulation_net, minimum = 0.3))

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