View source: R/ClusterPlotMDS.R
| ClusterPlotMDS | R Documentation |
Uses a projection method for dimensionality reduction so that the data can be visualized as two- or three-dimensional points colored by cluster.
ClusterPlotMDS(DataOrDistances, Cls, main = "Clustering",
DistanceMethod = "euclidean", OutputDimension = 3,
PointSize=1,Plotter3D="rgl",Colorsequence, ...)
DataOrDistances |
Either nonsymmetric [1:n,1:d] datamatrix of n cases and d features or symmetric [1:n,1:n] distance matrix |
Cls |
1:n numerical vector of numbers defining the classification as the main output of the clustering algorithm for the n cases of data. It has k unique numbers representing the arbitrary labels of the clustering. |
main |
String, title of plot |
DistanceMethod |
Method to compute distances, default "euclidean" |
OutputDimension |
Either two or three depending on user choice |
PointSize |
Scalar defining the size of points |
Plotter3D |
In case of 3 dimensions, choose either "plotly" or "rgl", |
Colorsequence |
[1:k] character vector of colors. By default, the color sequence defined in DataVisualizations is used |
... |
Please see |
If the dataset has more than three dimensions, MDS is performed as implemented in the smacof package [De Leeuw/Mair, 2011].
If smacof is not installed, classical metric MDS (see the definition in [Thrun, 2018]) is performed.
In both cases, the requested OutputDimension is used. Points are colored according to the labels in Cls.
If the dataset has no more than three dimensions, all dimensions are visualized and no dimensionality reduction is performed.
The rgl or plotly plot handler depending on Plotter3D
If DataVisualizations is not installed a 2D plot using native plot function is shown.
If smacof is not installed, classical metric MDS is used; see [Thrun, 2018] for the definition.
Michael Thrun
[De Leeuw/Mair, 2011] De Leeuw, J., & Mair, P.: Multidimensional scaling using majorization: SMACOF in R, Journal of statistical Software, Vol. 31(3), pp. 1-30. 2011.
[Thrun, 2018] Thrun, M. C.: Projection Based Clustering through Self-Organization and Swarm Intelligence, doctoral dissertation 2017, Springer, ISBN: 978-3-658-20539-3, Heidelberg, 2018.
Plot3D
data(Hepta)
ClusterPlotMDS(Hepta$Data,Hepta$Cls)
data(Leukemia)
ClusterPlotMDS(Leukemia$DistanceMatrix,Leukemia$Cls)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.