plot.hclustering {BasketballAnalyzeR} | R Documentation |
Plots hierarchical clustering from a 'hclustering' object
Description
Plots hierarchical clustering from a 'hclustering' object
Usage
## S3 method for class 'hclustering'
plot(
x,
title = NULL,
profiles = FALSE,
ncol.arrange = NULL,
circlize = FALSE,
horiz = TRUE,
cex.labels = 0.7,
colored.labels = TRUE,
colored.branches = FALSE,
rect = FALSE,
lower.rect = NULL,
min.mid.max = NULL,
...
)
Arguments
x |
an object of class |
title |
character or vector of characters (when plotting radial plots of cluster profiles; see Value), plot title(s). |
profiles |
logical; if |
ncol.arrange |
integer, number of columns when arranging multiple grobs on a page (active when plotting radial plots of cluster profiles; see Value). |
circlize |
logical; if |
horiz |
logical; if |
cex.labels |
numeric, the magnification to be used for labels (active when plotting a dendrogram; see Value). |
colored.labels |
logical; if |
colored.branches |
logical; if |
rect |
logical; if |
lower.rect |
numeric, a value of how low should the lower part of the rect be (active when plotting a dendrogram; see option |
min.mid.max |
numeric vector with 3 elements: lower bound, middle dashed line, upper bound for radial axis (active when plotting radial plots of cluster profiles; see Value). |
... |
other graphical parameters. |
Value
If x$k
is NULL
, plot.hclustering
returns a single ggplot2
object, displaying the pattern of the explained variance vs the number of clusters.
If x$k
is not NULL
and profiles=FALSE
, plot.hclustering
returns a single ggplot2
object, displaying the dendrogram.
If x$k
is not NULL
and profiles=TRUE
, plot.hclustering
returns a list of ggplot2
objects, displaying the radial plots of the cluster profiles.
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)