collapsedGraph: Reduce an adjacency matrix to include only central nodes and...

View source: R/betaMix.R

collapsedGraphR Documentation

Reduce an adjacency matrix to include only central nodes and nodes not assigned to any cluster.

Description

Return an adjacency matrix after collapsing clusters into their central nodes.

Usage

collapsedGraph(A, clustersInfo)

Arguments

A

An adjacency Matrix.

clustersInfo

Obtained from graphComponents

Value

A weighted adjacency matrix between clusters and unclustered nodes.

Examples

## Not run: 
   data(DrySeeds)
   res <- betaMix(DrySeeds, maxalpha = 1e-4,ppr = 0.01, ind=TRUE)
   adjMat <- getAdjMat(res)
   rownames(adjMat) = colnames(DrySeeds)
   SimComp <- graphComponents(adjMat)
   Adj1 <- collapsedGraph(adjMat, SimComp) > 0
   # with the igraph package, we can do:
   # plot(graph.adjacency(Adj1, mode="undirected"), vertex.label=rownames(Adj1),
   # vertex.label.cex=0.7, vertex.size=0, vertex.frame.color="white",
   # vertex.label.color='blue', edge.color='grey80',  asp=1)

## End(Not run)

haimbar/betaMix documentation built on Jan. 3, 2023, 12:54 p.m.