Learn R Programming

henna (version 0.3.4)

vertexComponents: 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")

Value

A factor vector representing the connected component of each vertex.

Arguments

df

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

colName

Name of the connected components column.

Examples

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

Run the code above in your browser using DataLab