ClusterPlotMDS: Plot Clustering using Dimensionality Reduction by MDS

View source: R/ClusterPlotMDS.R

ClusterPlotMDSR Documentation

Plot Clustering using Dimensionality Reduction by MDS

Description

Uses a projection method for dimensionality reduction so that the data can be visualized as two- or three-dimensional points colored by cluster.

Usage

ClusterPlotMDS(DataOrDistances, Cls, main = "Clustering",

DistanceMethod = "euclidean", OutputDimension = 3,

PointSize=1,Plotter3D="rgl",Colorsequence, ...)

Arguments

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 Plot3D in DataVisualizations

Details

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.

Value

The rgl or plotly plot handler depending on Plotter3D

Note

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.

Author(s)

Michael Thrun

References

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

See Also

Plot3D

Examples

data(Hepta)
ClusterPlotMDS(Hepta$Data,Hepta$Cls)

data(Leukemia)
ClusterPlotMDS(Leukemia$DistanceMatrix,Leukemia$Cls)



FCPS documentation built on Oct. 3, 2026, 9:06 a.m.