plot.MDSmap: Draws two-dimensional plots for multidimensional scaling...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/plot.MDSmap.R

Description

Draws two-dimensional plots for multidimensional scaling (MDS) from a 'MDSmap' object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## 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 MDSmap.

z.var

character vector; defines the set of variables (available in the data data frame of MDSmap) used to color-coding the points in the map (for scatter plots) or, alternatively, overlap to the map a colored level plot.

level.plot

logical; if TRUE, draws a level plot, otherwise draws a scatter plot (not active if zvar=NULL).

title

character, plot title.

labels

character vector, labels for (x, y) points (only for single scatter plot).

repel_labels

logical; if TRUE, draw text labels using repelling (not for highlighted points) (see geom_text_repel).

text_label

logical; if TRUE, draw a rectangle behind the text labels (not active if subset=NULL).

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; c(xmin,xmax,ymin,ymax) for the x- and y-axis limits of the plot.

palette

color palette.

contour

logical; if TRUE, contour lines are plotted (not active if level.plot=FALSE).

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

MDSmap

Examples

1
2
3
4
5
6
7
8
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)

BasketballAnalyzeR documentation built on July 2, 2020, 2:14 a.m.