davesil {dave}R Documentation

Modified version of silhouette plotting

Description

This is a wrapper for function silhouette in the cluster package. It also relies on the output of hclust and cutree.

Usage

davesil(ddist, o.hclr, o.relgr, ...)
dsil(ddist, o.hclr, o.relgr)

## Default S3 method:
davesil(ddist, o.hclr, o.relgr, ...)
## S3 method for class 'davesil'
plot(x,...,range=NULL)

Arguments

ddist

A distance matrix, probably the same as used for clustering

o.hclr

Output object of function hclust()

o.relgr

Output object of function cutree()

...

Plot parameter range(a,b) can be specified to limit plot to the subsed specified by a (begin) and b (end).

x

An object of class "davesil"

range

A vector of length 2, allows to plot a portion of the silhouette, e.g., range=c(1,5) plots the first 5.

Details

See function silhouette in the cluster package.

Value

An output list of class "davesil" with at least the following items:

sil

Data for drawing the silhouette, computed by silhouette()

names

The names of the items clustered, first 15 characters, used for plotting

Author(s)

Otto Wildi

References

Rousseeuw, P.J. (1987). Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. J. Comput. Appl. Math., 20: 53-65.

Wildi, O. 2017. Data Analysis in Vegetation Ecology. 3rd ed. CABI, Oxfordshire, Boston.

Examples

# An oridinary cluster analysis
ddr<- as.dist((1-cor(t(nveg)))/2)         # distance matrix, correlation as distance
o.hclr<- hclust(ddr,method="complete")
o.relgr<- cutree(o.hclr,k=3)
# Getting silhouette plot
o.davesil<- davesil(ddr,o.hclr,o.relgr)
plot(o.davesil)

[Package dave version 2.0 Index]