Learn R Programming

mclust (version 3.4.7)

plot.mclustDAtrain: Plot mclustDA training models.

Description

Plots representation of the models produced by mclustDAtrain. For multidimensional data, the plot is a coordinate projection and the ellipses shown correspond to the covariance matrices.

Usage

## S3 method for class 'mclustDAtrain':
plot(x, data, dimens=c(1,2), symbols=NULL, colors=NULL,
          scale = FALSE, xlim=NULL, ylim=NULL, CEX = 1, ...)

Arguments

x
An object produced by a call to mclustDAtrain.
data
A numeric matrix or data frame of observations. Categorical variables are not allowed. If a matrix or data frame, rows correspond to observations and columns correspond to variables.
dimens
A vector of length 2 giving the integer dimensions of the desired coordinate projections. The default is c(1,2), in which the first dimension is plotted against the second.
symbols
Either an integer or character vector assigning a plotting symbol to each unique class in classification. Elements in colors correspond to classes in order of appearance in the sequence of observations (the order used
colors
Either an integer or character vector assigning a color to each unique class in classification. Elements in colors correspond to classes in order of appearance in the sequence of observations (the order used by the fu
scale
A logical variable indicating whether or not the two chosen dimensions should be plotted on the same scale, and thus preserve the shape of the distribution. Default: scale=FALSE
xlim, ylim
Arguments specifying bounds for the ordinate, abscissa of the plot. This may be useful for when comparing plots.
CEX
An argument specifying the size of the plotting symbols. The default value is 1.
...
Other graphics parameters.

Side Effects

A plot showing a two-dimensional coordinate projection of the data, together with the location of the mixture components, classification, uncertainty, and/or classification errors.

References

C. Fraley and A. E. Raftery (2002). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97:611-631.

C. Fraley and A. E. Raftery (2006). MCLUST Version 3 for R: Normal Mixture Modeling and Model-Based Clustering, Technical Report no. 504, Department of Statistics, University of Washington.

See Also

coordProj, mclust1Dplot, mclust2Dplot, mclustOptions

Examples

Run this code
odd <- seq(from = 1, to = nrow(iris), by = 2)

irisTrain <- mclustDAtrain(data = iris[odd,-5], labels = iris[odd,5])
plot(irisTrain, iris[odd,-5])

Run the code above in your browser using DataLab