plot.kclustering: Plot k-means clustering from a 'kclustering' object

View source: R/plot.kclustering.R

plot.kclusteringR Documentation

Plot k-means clustering from a 'kclustering' object

Description

Plot k-means clustering from a 'kclustering' object

Usage

## S3 method for class 'kclustering'
plot(
  x,
  title = NULL,
  ncol.arrange = NULL,
  min.mid.max = NULL,
  label.size = 2.5,
  ...
)

Arguments

x

an object of class kclustering.

title

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

ncol.arrange

integer, number of columns when arranging multiple grobs on a page (active when plotting radial plots of cluster profiles; see Value).

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

label.size

numeric; label font size (default 2.5).

...

other graphical parameters.

Value

If x$k is NULL, plot.kclustering returns a single ggplot2 object, displaying the pattern of the explained variance vs the number of clusters.

If x$k is not NULL, plot.kclustering 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

kclustering, radialprofile

Examples

FF <- fourfactors(Tbox,Obox)
X <- with(FF, data.frame(OD.Rtg=ORtg/DRtg,
               F1.r=F1.Def/F1.Off, F2.r=F2.Off/F2.Def,
               F3.O=F3.Def, F3.D=F3.Off))
X$P3M <- Tbox$P3M
X$STL.r <- Tbox$STL/Obox$STL
kclu1 <- kclustering(X)
plot(kclu1)
kclu2 <- kclustering(X, k=9)
plot(kclu2)

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