Learn R Programming

flexclust (version 1.3-4)

bwplot-methods: Box-Whisker Plot Methods in Package `flexclust'

Description

Seperate boxplot of variables in each cluster in comparison with boxplot for complete sample.

Usage

"bwplot"(x, data, xlab="", strip.labels=NULL, strip.prefix="Cluster ", col=NULL, shade=!is.null(shadefun), shadefun=NULL, ...)

Arguments

x
An object of class "kcca".
data
If not NULL, cluster membership is predicted for the new data and used for the plots. By default the values from the training data are used.
xlab, ...
Graphical parameters.
col
Vector of colors for the clusters.
strip.labels
Vector of strings for the strips of the Trellis display.
strip.prefix
Prefix string for the strips of the Trellis display.
shade
If TRUE, only boxes with larger deviation from the median or quartiles of the total population of the respective variables are filled with color.
shadefun
A function or name of a function to compute which boxes are shaded, e.g. "medianInside" (default) or "boxOverlap".

Examples

Run this code
  set.seed(1)
  cl <- cclust(iris[,-5], k=3, save.data=TRUE)
  bwplot(cl)

  ## fill only boxes with color which do not contain the overall median
  ## (grey dot of background box)
  bwplot(cl, shade=TRUE)

  ## fill only boxes with color which do not overlap with the box of the
  ## complete sample (grey background box)
  bwplot(cl, shadefun="boxOverlap")

Run the code above in your browser using DataLab