Learn R Programming

GFORCE (version 0.1.4)

gforce.hclust: Hierarchical Clustering with Estimation of \(K\).

Description

Clusters \(n\) points of dimension \(m\) using a complete linkage algorithm and estimates \(K\).

Usage

gforce.hclust(X = NULL, dists = NULL, R_only = FALSE)

Arguments

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 R_only == FALSE, then the included native code implementation will be used. Otherwise, an R implementation is used.

Value

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\).

References

D. Defays. An efficient algorithm for a complete link method. The Computer Journal, 1977.

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab