Learn R Programming

henna (version 0.3.4)

connectedComponents: Find the connected components of a graph data frame

Description

This function finds the connected components of a graph data frame.

Usage

connectedComponents(df, colName = "component")

Value

A data frame with a column indicating the connected component of each edge.

Arguments

df

A data frame with two categorical columns representing the edges of a graph.

colName

Name of the connected components column to be added.

Examples

Run this code
df <- data.frame(
gene1 = paste0('G', c(1, 2, 6, 7, 8, 9,
11, 25, 32, 17, 18)),
gene2 = paste0('G', c(2, 8, 8, 8, 1, 25,
32, 24, 24, 26, 26))
)
connectedComponents(df)

Run the code above in your browser using DataLab