View source: R/MixmodResults.R
plotCluster | R Documentation |
MixmodResults
]Biplot of two variables from a quantitative data set. Use parameters and partition from a
[MixmodResults
] object to distinguish the different clusters.
plotCluster(
x,
data,
variable1 = colnames(data)[1],
variable2 = colnames(data)[2],
col = x@partition + 1,
pch = x@partition,
xlab = variable1,
ylab = variable2,
add.ellipse = TRUE,
...
)
x |
an object of class [ |
data |
a data frame containing a quantitative data set. |
variable1 |
index or character containing the name of the first variable. First column of data by default. |
variable2 |
index or character containing the name of the second variable. Second column of data by default. |
col |
a specification for the default plotting color. By default partition is used to separate clusters with different colors. |
pch |
either an integer specifying a symbol or a single character to be used as the default in plotting points. By default partition is used to separate clusters with different symbols. |
xlab |
a title for the x axis. Variable1 by default. |
ylab |
a title for the y axis. Variable2 by default. |
add.ellipse |
a boolean. Add ellipses to graph. TRUE by default. |
... |
further arguments passed to or from other methods |
Ellipsoids (i.e. linear transformations of hyperspheres)
centered at the mean can be drawn using the parameters computed by MIXMOD.
The directions of the principal axes of the ellipsoids are given by the eigenvectors of the covariance matrix \Sigma
.
The squared relative lengths of the principal axes are given by the corresponding eigenvalues.
plot
data(geyser)
xem1 <- mixmodCluster(geyser, 3)
plotCluster(xem1["bestResult"], geyser)
data(iris)
xem2 <- mixmodCluster(iris[1:4], 2:6)
plotCluster(xem2["bestResult"], iris, variable1 = "Sepal.Length", variable2 = "Sepal.Width")
plotCluster(xem2["bestResult"], iris, variable1 = 1, variable2 = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.