hclustvar2: Hierarchical clustering of variables from a covariance matrix

View source: R/hclustvar2.R

hclustvar2R Documentation

Hierarchical clustering of variables from a covariance matrix

Description

Ascendant hierarchical clustering of a set of variables from a covariance/correlation matrix.

Usage

hclustvar2(x, init = NULL)

Arguments

x

a covariance or correlation matrix.

init

an initial partition (a vector of integers indicating the cluster to which each variable is allocated).

Value

height

a set of p-1 non-decreasing real values: the values of the aggregation criterion.

clusmat

a p by p matrix with group memberships where each column k corresponds to the elements of the partition in k clusters.

merge

a p-1 by 2 matrix. Row i of merge describes the merging of clusters at step i of the clustering. If an element j in the row is negative, then observation -j was merged at this stage. If j is positive then the merge was with the cluster formed at the (earlier) stage j of the algorithm. Thus negative entries in merge indicate agglomerations of singletons, and positive entries indicate agglomerations of non-singletons.

See Also

cutreevar, plot.hclustvar, stability

Examples

data(decathlon)
x <- cor(decathlon[,1:10])
tree <- hclustvar2(x)
plot(tree, hang = -1, xlab="", sub="")


ClustOfVar documentation built on June 8, 2025, 11:17 a.m.