hclustering {BasketballAnalyzeR} | R 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 |
labels |
character, row labels. |
linkage |
character, the agglomeration method to be used in |
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 ofk
(from 1 tonclumax
) at which the variance between of the clusterization is evaluated
-
VarianceBetween
numeric vector, values of the variance between evaluated fork
inclusterRange
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 classhclust
, seehclust
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
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)