Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

slice

Slice a Hierarchical Clustering Dendrogram with a Mouse


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

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)

See Also

Examples

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

Optimal Partitioning of Similarity Relations

v3.0-3
GPL (>= 2)
Authors
David W. Roberts <droberts@montana.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.