
Multidimensional scaling (MDS) in 2 dimensions
MDSmap(data, std = TRUE)
a numeric matrix, data frame or "dist"
object (see dist
).
logical; if TRUE, data
columns are standardized (centered and scaled).
An object of class MDSmap
, i.e. a list with 4 objects:
points
, a 2-column vector of the fitted configuration (see isoMDS
);
stress
, the final stress achieved in percent (see isoMDS
);
data
, the input data frame;
std
, the logical std
input.
If data
is an object of class "dist"
, std
is not active and data
is directly inputted into MASS::isoMDS
.
P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.
# NOT RUN {
data <- with(Pbox, data.frame(PTS, P3M, P2M, REB=OREB+DREB, 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)
# }
Run the code above in your browser using DataLab