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 hclustering.

title

character or vector of characters (when plotting radial plots of cluster profiles; see Value), plot title(s).

profiles

logical; if TRUE, displays radial plots of cluster profiles (active if x$k is not NULL; see Value).

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 TRUE, plots a circular dendrogram (active when plotting a dendrogram; see Value).

horiz

logical; if TRUE, plots an horizontal dendrogram (active when plotting a non circular dendrogram; see Value).

cex.labels

numeric, the magnification to be used for labels (active when plotting a dendrogram; see Value).

colored.labels

logical; if TRUE, assigns different colors to labels of different clusters (active when plotting a dendrogram; see Value).

colored.branches

logical; if TRUE, assigns different colors to branches of different clusters (active when plotting a dendrogram; see Value).

rect

logical; if TRUE, draws rectangles around the branches in order to highlight the corresponding clusters (active when plotting a dendrogram; see Value).

lower.rect

numeric, a value of how low should the lower part of the rect be (active when plotting a dendrogram; see option lower_rect of rect.dendrogram).

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

hclustering, radialprofile.

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)

[Package BasketballAnalyzeR version 0.5.0 Index]