hclustering: Agglomerative hierarchical clustering

View source: R/hclustering.R

hclusteringR Documentation

Agglomerative hierarchical clustering

Description

Agglomerative hierarchical clustering

Usage

hclustering(data, k = NULL, nclumax = 10, labels = NULL, linkage = "ward.D")

Arguments

data

numeric data frame.

k

integer, number of clusters.

nclumax

integer, maximum number of clusters (when k=NULL).

labels

character, row labels.

linkage

character, the agglomeration method to be used in hclust (see method in hclust).

Details

The hclustering function performs a preliminary standardization of columns in data.

Value

A hclustering object.

If k is NULL, the hclustering object is a list of 3 elements:

  • k NULL

  • clusterRange integer vector, values of k (from 1 to nclumax) at which the variance between of the clusterization is evaluated

  • VarianceBetween numeric vector, values of the variance between evaluated for k in clusterRange

If k is not NULL, the hclustering object is a list of 5 elements:

  • k integer, number of clusters

  • Subjects data frame, subjects' cluster identifiers

  • ClusterList list, clusters' composition

  • Profiles data frame, clusters' profiles, i.e. the average of the variables within clusters and the cluster eterogeineity index (CHI)

  • Hclust an object of class hclust, see hclust

Author(s)

Marco Sandri, Paola Zuccolotto, Marica Manisera (basketballanalyzer.help@unibs.it)

References

P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.

See Also

plot.hclustering, hclust

Examples

data <- with(Pbox, data.frame(PTS, P3M, REB=OREB+DREB, AST, TOV, STL, BLK, PF))
data <- subset(data, Pbox$MIN >= 1500)
ID <- Pbox$Player[Pbox$MIN >= 1500]
hclu1 <- hclustering(data)
plot(hclu1)
hclu2 <- hclustering(data, labels=ID, k=7)
plot(hclu2)

sndmrc/BasketAnalyzeR documentation built on June 6, 2023, 12:52 a.m.