Learn R Programming

flexclust (version 1.3-4)

shadowStars: Shadow Stars

Description

Shadow star plots and corresponding panel functions.

Usage

shadowStars(object, which=1:2, project=NULL, width=1, varwidth=FALSE, panel=panelShadowStripes, box=NULL, col=NULL, add=FALSE, ...)
panelShadowStripes(x, col, ...) panelShadowViolin(x, ...) panelShadowBP(x, ...) panelShadowSkeleton(x, ...)

Arguments

object
an object of class "kcca"
which
index numbers of dimensions of (projected) input space to plot.
project
projection object for which a predict method exists, e.g., the result of prcomp.
width
width of vertices connecting the cluster centroids.
varwidth
logical, shall all vertices have the same width or should the width be proportional to number of points shown on the vertex?
panel
function used to draw vertices.
box
color of rectangle drawn around each vertex.
col
a vector of colors for the clusters.
add
logical, start a new plot?
...
passed on to panel function.
x
shadow values of data points corresponding to the vertex.

Details

The shadow value of each data point is defined as twice the distance to the closest centroid divided by the sum of distances to closest and second-closest centroid. If the shadow values of a point is close to 0, then the point is close to its cluster centroid. If the shadow value is close to 1, it is almost equidistant to the two centroids. Thus, a cluster that is well separated from all other clusters should have many points with small shadow values.

The neighborhood graph of a cluster solution connects two centroids by a vertex if at least one data point has the two centroids as closest and second closest. The width of the vertex is proportional to the sum of shadow values of all points having these two as closest and second closest. A shadow star depicts the distribution of shadow values on the vertex, see Leisch (2009) for details.

Currently four panel functions are available:

panelShadowStripes:
line segment for each shadow value.

panelShadowViolin:
violin plot of shadow values.

panelShadowBP:
box-percentile plot of shadow values.

panelShadowSkeleton:
average shadow value.

References

Friedrich Leisch. Neighborhood graphs, stripes and shadow plots for cluster visualization. Statistics and Computing, 2009. Accepted for publication on 2009-06-16.

See Also

shadow

Examples

Run this code
data(Nclus)
set.seed(1)
c5 <- cclust(Nclus, 5, save.data=TRUE)
c5
plot(c5)

shadowStars(c5)
shadowStars(c5, varwidth=TRUE)

shadowStars(c5, panel=panelShadowViolin)
shadowStars(c5, panel=panelShadowBP)

## always use varwidth=TRUE with panelShadowSkeleton, otherwise a few
## large shadow values can lead to misleading results:
shadowStars(c5, panel=panelShadowSkeleton)
shadowStars(c5, panel=panelShadowSkeleton, varwidth=TRUE)

Run the code above in your browser using DataLab