chclust {rioja} | R Documentation |
Constrained hierarchical clustering
Description
Constrained hierarchical clustering.
Usage
chclust(d, method = "coniss")
## S3 method for class 'chclust'
plot(x, labels = NULL, hang = 0.1, axes = TRUE,
xvar=1:(length(x$height)+1), xlim=NULL, ylim=NULL,
x.rev = FALSE, y.rev=FALSE, horiz=FALSE, ...)
bstick(n, ...)
## S3 method for class 'chclust'
bstick(n, ng=10, plot=TRUE, ...)
Arguments
d |
a dissimilarity structure as produced, for example, by |
method |
the agglomeration method to be used. This should be (an unambiguous abbreviation of) either "coniss" or "conslink". |
x , n |
a constrained cluster object of class |
xvar |
numeric vector containing x-coordinates for the leaves of the dendrogram (see details below). |
x.rev , y.rev |
logical flags to reverse the x- or y-axis (and dendrogram labels). Defaults to |
horiz |
logical indicating if the dendrogram should be drawn horizontally or not. Note that y-axis still refers to the dendrogram height even after rotating. |
xlim , ylim |
optional x- and y-limits of the plot, passed to the underlying plto function. The defaults for these show the full dendrogram. |
labels , hang , axes |
further arguments as in |
ng |
number of groups to display. |
plot |
logical to plot a broken stick model. Defaults to |
... |
further graphical arguments. Use |
Details
chclust
performs a constrained hierarchical clustering of a distance matrix, with clusters constrained by sample order. Returns an object of class chclust
which can be plotted and interrogated. See Grimm (1987), Gordon & Birks (1972) and Birks & Gordon (1985) for discusssiom of the coniss and conslink algorithms. The resulting dendrogram can be plotted with plot
. This is an extension of plot
method for hclust that allows the dendrogram to be plotted horizontally or vertically (default). plot
also accepts a numeric vector coordinates for x-axis positions of the leaves of the dendrogram. These could, for example, be the stratigraphic depths of core samples or geographic distances along a line transect.
bstick.chclust
compares the dispersion of a hierarchical classification to that obtained from a broken stick model and displays the results graphically. See Bennett (1996) for details. bstick
is a generic function and the default method is defined in package vegan
. If package vegan
is installed the function may be called using vegan::bstick
, otherwise use bstick.chclust
.
Value
Function chclust
returns an object of class chclust
, derived from hclust
.
Author(s)
Steve Juggins
References
Bennett, K. (1996) Determination of the number of zones in a biostratigraphic sequence. New Phytologist, 132, 155-170.
Birks, H.J.B. & Gordon, A.D. (1985) Numerical Methods in Quaternary Pollen Analysis Academic Press, London.
Gordon, A.D. & Birks, H.J.B. (1972) Numerical methods in Quaternary palaeoecology I. Zonation of pollen diagrams. New Phytologist, 71, 961-979.
Grimm, E.C. (1987) CONISS: A FORTRAN 77 program for stratigraphically constrained cluster analysis by the method of incremental sum of squares. Computers & Geosciences, 13, 13-35.
See Also
Examples
data(RLGH)
diss <- dist(sqrt(RLGH$spec/100))
clust <- chclust(diss)
bstick(clust, 10)
# Basic diagram
plot(clust, hang=-1)
# Rotated through 90 degrees
plot(clust, hang=-1, horiz=TRUE)
# Rotated and observations plotted according to sample depth.
plot(clust, xvar=RLGH$depths$Depth, hang=-1, horiz=TRUE, x.rev=TRUE)
# Conslink for comparison
clust <- chclust(diss, method = "conslink")
plot(clust, hang=-1)