Description Usage Arguments Details Value Examples
Agglomerative hierarchical clustering for sparse similarity matrices.
1 2 |
S |
sparse similarity matrix of type dgCMatrix |
linkage |
linkage criteria. It determines the similarity (or originally distance) between sets of nodes. See details. |
check.symmetry |
logical. If TRUE, tests if the input similarity matrix is symmetric. |
Let A and B be two disjoint subsets of points (nodes of the graph). “Complete linkage” is min S(a,b) for a \in A and b \in B, “single linkage” is max S(a,b) for a \in A and b \in B and “Average linkage” is 1/(|A|.|B|) * sum_{a \in A} sum_{b \in B} S(a,b).
dendrogram of type hclust
1 2 3 4 5 6 7 8 9 10 11 12 13 | library("Matrix")
library("igraph")
A <- Matrix(0, nrow = 6, ncol = 6, sparse = TRUE)
A[1,2] <- 2; A[1,5] <- 3; A[1,4] <- 2.5; A[2,5] <- 4
A[3,4] <- 2; A[3,5] <- 6; A[4,5] <- 5; A[5,6] <- 4.6
A <- A + t(A)
G <- graph.adjacency(A, mode = "undirected", weighted=TRUE)
plot(G, edge.label=E(G)$weight, vertex.label=V(G)-1)
H <- sparseAHC(A, "average", TRUE)
plot(H)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.