shortestPathDistance | R Documentation |
return the adjacency matrix of expMat connecting neighbors up to numSteps away.
shortestPathDistance(AdjMat, numSteps = 0)
AdjMat |
An adjacency Matrix (0/1). |
numSteps |
The maximum number of edges between pairs of nodes. If numSteps=0, returns the input matrix. numSteps=1 adds neighbors of direct neighbors, etc. |
A Matrix containing the shortset paths between nodes i and j
## Not run: data(SIM,package = "betaMix") res <- betaMix(betaMix::SIM, maxalpha = 1e-6,ppr = 0.01,subsamplesize = 30000, ind=TRUE) adjMat <- getAdjMat(res) AdjMat <- shortestPathDistance(adjMat, numSteps=2) Matrix::image( (AdjMat>0)[1:200,1:200]) adjMat1 <- AdjMat>0 SimComp <- graphComponents(adjMat1) head(summarizeClusters(SimComp)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.