vertexComponents: Return the connected components of vertices

View source: R/geometry.R

vertexComponentsR Documentation

Return the connected components of vertices

Description

This function returns the connected components of vertices from a graph data frame in which edges have been assigned connected components.

Usage

vertexComponents(df, colName = "component")

Arguments

df

A data frame with two categorical columns representing graph edges and a connected components column.

colName

Name of the connected components column.

Value

A factor vector representing the connected component of each vertex.

Examples

df <- data.frame(gene1 = c('A', 'B', 'C', 'A'),
gene2 = c('B', 'D', 'F', 'G'),
component = c(1, 1, 2, 1))
vertexComponents(df)


henna documentation built on Feb. 17, 2026, 9:08 a.m.