plot.MDSmap {BasketballAnalyzeR} | R Documentation |
Draws two-dimensional plots for multidimensional scaling (MDS) from a 'MDSmap' object
Description
Draws two-dimensional plots for multidimensional scaling (MDS) from a 'MDSmap' object
Usage
## S3 method for class 'MDSmap'
plot(
x,
z.var = NULL,
level.plot = TRUE,
title = NULL,
labels = NULL,
repel_labels = FALSE,
text_label = TRUE,
subset = NULL,
col.subset = "gray50",
zoom = NULL,
palette = NULL,
contour = FALSE,
ncol.arrange = NULL,
...
)
Arguments
x |
an object of class |
z.var |
character vector; defines the set of variables (available in the |
level.plot |
logical; if TRUE, draws a level plot, otherwise draws a scatter plot (not active if |
title |
character, plot title. |
labels |
character vector, labels for (x, y) points (only for single scatter plot). |
repel_labels |
logical; if |
text_label |
logical; if |
subset |
logical vector, to select a subset of points to be highlighted. |
col.subset |
character, color for the subset of points. |
zoom |
numeric vector with 4 elements; |
palette |
color palette. |
contour |
logical; if |
ncol.arrange |
integer, number of columns when arranging multiple grobs on a page. |
... |
other graphical parameters. |
Value
A single ggplot2
plot or a list of ggplot2
plots
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 <- data.frame(Pbox$PTS, Pbox$P3M, Pbox$P2M, Pbox$OREB + Pbox$DREB, Pbox$AST,
Pbox$TOV,Pbox$STL, Pbox$BLK)
names(data) <- c('PTS','P3M','P2M','REB','AST','TOV','STL','BLK')
selp <- which(Pbox$MIN >= 1500)
data <- data[selp,]
id <- Pbox$Player[selp]
mds <- MDSmap(data)
plot(mds, labels=id, z.var="P2M", level.plot=FALSE, palette=rainbow)