gforce.hclust {GFORCE} | R Documentation |
Clusters n points of dimension m using a complete linkage algorithm and estimates K.
gforce.hclust(X = NULL, dists = NULL, R_only = FALSE)
X |
n x m matrix. Each row is treated as a point in R^m. |
dists |
n x n symmetric matrix. This encodes the distances between the n points. |
R_only |
logical expression. If |
Returns an object with the components:
K
an estimate of the number of clusters.
clusters
a n dimensional integer vector. Entry i to the cluster assignment of the data point given by row i of X
.
MSE
a n dimensional vector of the mean squared errors of each choice of K.
D. Defays. An efficient algorithm for a complete link method. The Computer Journal, 1977.
m <- 10 n <- 10 X <- matrix(MASS::mvrnorm(m*n,rep(0,m*n),diag(m*n)), nrow = n) hc_res <- gforce.hclust(X=X)