slice: Slice a Hierarchical Clustering Dendrogram with a Mouse

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Allows a simple classification of objects by slicing a dendrogram of a hierarchical cluster analysis graphically with a mouse, or by simply giving a number.

Usage

1
slice(clust, k=NULL)

Arguments

clust

an object of class ‘hclust’ produced by hclust

k

a desired number of clusters. If null, the function waits on a mouse click

Value

an object of class ‘clustering’, a list with a vector of cluster memberships

Note

This function is a simple wrapper for cutree that allows users to click their mouse at the height they desire to slice the dendrogram, and to establish the result with a class of ‘clustering’ for ease of use in other functions. If you want to use the mouse, the dendrogram must have been previously plotted in the current graphic device.

Author(s)

David W. Roberts droberts@montana.edu http://ecology.msu.montana.edu/labdsv/R

See Also

ordpart

Examples

1
2
3
4
5
6
data(shoshveg)
dis.bc <- dsvdis(shoshveg,'bray/curtis')
demo <- hclust(dis.bc,'ave')
ave.5 <- slice(demo,5)
## Not run: plot(demo)
## Not run: ave.clust <- slice(demo)

optpart documentation built on March 26, 2020, 6:18 p.m.

Related to slice in optpart...