cov.rob.covEllipses(x, ...)
## S3 method for class 'boxM':
covEllipses(x, ...)
## S3 method for class 'data.frame':
covEllipses(x, group, pooled = TRUE, method = c("classical", "mve", "mcd"), ...)
## S3 method for class 'matrix':
covEllipses(x, group, pooled = TRUE, method = c("classical", "mve", "mcd"), ...)
## S3 method for class 'default':
covEllipses(x, means, df,
labels = NULL, variables = 1:2, level = 0.68,
segments = 40,
center = FALSE, center.pch = "+", center.cex = 2,
col = getOption("heplot.colors", c("red", "blue", "black", "darkgreen",
"darkcyan", "magenta", "brown", "darkgray")),
lty = 1, lwd = 2,
fill = FALSE, fill.alpha = 0.3,
label.pos = 0,
xlab, ylab, main = "",
xlim, ylim, axes = TRUE,
offset.axes, add = FALSE, warn.rank = FALSE, ...)n=nrow(x) doing the same.
If missing, a single covariance ellipse is drawn.TRUE, the pooled covariance matrix is also computed and plotted"classical"),
or minimum volume ellipsoid ("mve"), or
minimum covariance determinant ("mcd").pooled=TRUE).
Rows are the groups, and columns are the variables. It is assumed that the means have
column names corresponding to the variables inTRUE,
indicating that group labels are taken as the names of the covariance matrices.
Use labels="" to suppress group labels1:2.0.68.40.TRUE, the covariance ellipses are centered at the centroid."+".2.2:1.1:2.[0,1], where 0 means fully transparent and 1 means fully opaque. Defaults to 0.3.0:4) or character strings
(in c("center", "bottom", "left", "top", "right")) use in labeling ellipses,
recycled as necessary.
Values of 1, 2, 3 and 4, respectively indicate positions"".TRUETRUE, add to the current plot; the default is FALSE.TRUE, do not suppress warnings about the rank of the
covariance matrices; the default is FALSE.plot, text,
and points"covEllipse",
which is a list of the coordinates for the ellipses drawn.heplot,
boxM,
cov.robdata(iris)
covEllipses(iris[,1:4], iris$Species)
covEllipses(iris[,1:4], iris$Species, fill=TRUE, method="mve", add=TRUE, labels="")
x <- boxM(iris[, 1:4], iris[, "Species"])
x
covEllipses(x, fill=c(rep(FALSE,3), TRUE) )
covEllipses(x, fill=c(rep(FALSE,3), TRUE), center=TRUE, label.pos=1:4 )
cov <- c(x$cov, pooled=list(x$pooled))
df <- c(table(iris$Species)-1, nrow(iris)-3)
covEllipses(cov, x$means, df, label.pos=3, fill=c(rep(FALSE,3), TRUE))
covEllipses(cov, x$means, df, label.pos=3, fill=c(rep(FALSE,3), TRUE), center=TRUE)Run the code above in your browser using DataLab