Learn R Programming

optpart (version 3.0-3)

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

See Also

ordpart

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab