HierarchicalClustering: Hierarchical Clustering

View source: R/HierarchicalClustering.R

HierarchicalClusteringR Documentation

Hierarchical Clustering

Description

Wrapper for various agglomerative hierarchical clustering algorithms.

Usage

HierarchicalClustering(DataOrDistances,ClusterNo,Type='SingleL',Fast=TRUE,Data,...)

Arguments

DataOrDistances

Either nonsymmetric [1:n,1:d] numerical matrix of a dataset to be clustered. It consists of n cases of d-dimensional data points. Every case has d attributes, variables or features.

or

symmetric [1:n,1:n] distance matrix, e.g. as.matrix(dist(Data,method))

ClusterNo

A number k which defines k different clusters to be built by the algorithm.

Type

Method of cluster analysis: "Ward", "SingleL", "CompleteL", "AverageL" (UPGMA), "WPGMA" (mcquitty), "MedianL" (WPGMC), "CentroidL" (UPGMC), "Minimax", "MinEnergy", "Gini","HDBSCAN", or "Sparse"

Fast

If TRUE and fastcluster installed, then a faster implementation of the methods above can be used except for "Minimax", "MinEnergy", "Gini" or "HDBSCAN"

Data

[1:n,1:d] data matrix in the case that DataOrDistances is missing and partial matching does not work.

...

Further arguments passed on to either HierarchicalClusterData, HierarchicalClusterDists, MinimalEnergyClustering or GenieClustering (for "Gini"), HierarchicalDBSCAN (for HDBSCAN) or SparseClustering (for Sparse).

Details

Please see HierarchicalClusterData and HierarchicalClusterDists or the other functions listed above.

It should be noted that in case of "HDBSCAN" the number of clusters is manually selected by cutree to have the same convention as the other algorithms. Usually, "HDBSCAN" selects the number of clusters automatically.

Value

List of

Cls

If, ClusterNo>0: [1:n] numerical vector with n numbers defining the classification as the main output of the clustering algorithm. It has k unique numbers representing the arbitrary labels of the clustering. Otherwise for ClusterNo=0: NULL

Dendrogram

Dendrogram of hierarchical clustering algorithm

Object

Ultrametric tree of hierarchical clustering algorithm

Author(s)

Michael Thrun

See Also

HierarchicalClusterData

HierarchicalClusterDists,

MinimalEnergyClustering.

Examples

data('Hepta')
out=HierarchicalClustering(Hepta$Data,ClusterNo=7)

FCPS documentation built on Oct. 19, 2023, 5:06 p.m.