plot,flowClust-method {flowClust}R Documentation

Scatterplot of Clustering Results

Description

This method generates scatterplot revealing the cluster assignment, cluster boundaries according to the specified percentile as well as supplemental information like outliers or filtered observations.

Usage

## S4 method for signature 'flowClust':
plot(x, data, subset=c(1,2), ellipse=TRUE, show.outlier=TRUE,
     show.rm=FALSE, include=1:(x@K), main=NULL, grayscale=FALSE,
     col=(if (grayscale) gray(1/4) else 2:(length(include)+1)),
     pch=".", cex=0.6, col.outlier=gray(3/4), pch.outlier=".",
     col.rm=1, pch.rm=1, cex.rm=0.6, ecol=1, elty=1, level=0.9,
     cutoff=FALSE, npoints=501, add=FALSE, ...)

Arguments

x Object returned from flowClust.
data A matrix, data frame of observations, or object of class flowFrame. This is the object on which flowClust was performed.
subset A numeric vector of length two indicating which two variables are selected for the scatterplot. Alternatively, a character vector containing the names of the two variables is allowed if x@varNames is not NULL.
ellipse A logical value indicating whether the cluster boundary is to be drawn or not. If TRUE, the boundary will be drawn according to the level specified by level or cutoff.
show.outlier A logical value indicating whether outliers will be explicitly shown or not.
show.rm A logical value indicating whether filtered observations will be shown or not.
include A numeric vector specifying which clusters will be shown on the plot. By default, all clusters are included.
main Title of the plot.
grayscale A logical value specifying if a grayscale plot is desired. This argument takes effect only if the default values of relevant graphical arguments are taken.
col Color(s) of the plotting characters. May specify a different color for each cluster.
pch Plotting character(s) of the plotting characters. May specify a different character for each cluster.
cex Size of the plotting characters. May specify a different size for each cluster.
col.outlier Color of the plotting characters denoting outliers.
pch.outlier Plotting character(s) used to denote outliers. May specify a different character for each cluster.
col.rm Color of the plotting characters denoting filtered observations.
pch.rm Plotting character used to denote filtered observations.
cex.rm Size of the plotting character used to denote filtered observations.
ecol Color(s) of the lines representing the cluster boundaries. May specify a different color for each cluster.
elty Line type(s) drawing the cluster boundaries. May specify a different line type for each cluster.
level A numeric value between 0 and 1 specifying the threshold used to call a point an outlier. The default is 0.9, meaning that any point outside the 90% quantile region, shown as the cluster boundary on the graph, will be called an outlier. Note that this argument takes effect only if cutoff is FALSE; see below for more details.
cutoff Either a logical or numeric value specifying the criterion used to identify outliers and determine cluster boundaries. If TRUE, the criterion stated in x@ruleOutliers will be used; if FALSE (the default), the criterion will be set according to level. Otherwise, a numeric value will be taken as the threshold (e.g., 0.5) for u, a quantity used to measure the degree of “outlyingness” based on the Mahalanobis distance. Please refer to Lo et al. (2008) for more details.
npoints The number of points used to draw each cluster boundary.
add A logical value. If TRUE, add to the current plot.
... Further graphical parameters passed to the generic function plot.

Note

The cluster boundaries need not be elliptical since Box-Cox transformation has been performed.

Author(s)

Raphael Gottardo <raph@stat.ubc.ca>, Kenneth Lo <c.lo@stat.ubc.ca>

References

Lo, K., Brinkman, R. R. and Gottardo, R. (2008) Automated Gating of Flow Cytometry Data via Robust Model-based Clustering. Cytometry A 73, 321-332.

See Also

flowClust

Examples

res <- flowClust(iris[,1:4], K=3)

plot(res, data=iris, subset=c("Sepal.Width", "Petal.Width"),
    pch=1, pch.outlier=2)
plot(res, data=iris, subset=c(2,4), ellipse=FALSE,
    show.outlier=FALSE, pch=1)

plot(res, data=iris, subset=c("Petal.Length", "Petal.Width"),
    include=c(2,3), pch=1, pch.outlier=1)
plot(res, data=iris, subset=c("Petal.Length", "Petal.Width"),
    include=c(2,3), grayscale=TRUE, pch=1, pch.outlier=1,
    level=0.8)

[Package flowClust version 1.3.2 Index]