Plot Projection and Contour | R Documentation |
The function plots multivariate data on 2D plane with contour.
Typically, the contour is built via projection pursuit or SVD
algorithms, such as project.on.2d()
.
plotppcontour(da, Pi, Mu, S, class, class.true = NULL, n.grid = 128,
angle = 0, xlab = "", ylab = "", main = "")
da |
a projected data matrix, dimension |
Pi |
proportion, length |
Mu |
the projected centers of cluster, dimension |
S |
projected matrices of dispersion, dimension
|
class |
id of classifications, length |
class.true |
ture id of classifications if available, length |
n.grid |
number of grid points. |
angle |
a rotation angle ( |
xlab |
an option for |
ylab |
an option for |
main |
an option for |
This function plots projection output of project.on.2d()
.
da
, Mu
, and S
are projected by some projection matrices
obtained via SVD or projection pursuit algorithms. The projection is made
on a 2D plane in the direction in which clusters of data x
are most distinguishable to visualize.
A 2D projection plot is returned.
Only distinguishable for up to 7 clusters due to the limited color schemes.
Wei-Chen Chen wccsnow@gmail.com and Ranjan Maitra.
https://www.stat.iastate.edu/people/ranjan-maitra
project.on.2d()
.
## Not run:
library(EMCluster, quietly = TRUE)
library(MASS, quietly = TRUE)
set.seed(1234)
### Crabs.
x <- as.matrix(crabs[, 4:8])
ret <- init.EM(x, nclass = 4, min.n = 20)
ret.proj <- project.on.2d(x, ret)
### Plot.
pdf("crabs_ppcontour.pdf", height = 5, width = 5)
plotppcontour(ret.proj$da, ret.proj$Pi, ret.proj$Mu, ret.proj$S,
ret.proj$class, angle = pi/6, main = "Crabs K = 4")
dev.off()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.