powered by
This function finds the connected components of a graph data frame.
connectedComponents(df, colName = "component")
A data frame with a column indicating the connected component of each edge.
A data frame with two categorical columns representing the edges of a graph.
Name of the connected components column to be added.
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