prune.clust {maptree}R Documentation

Prunes a Hierarchical Cluster Tree

Description

Reduces a hierarchical cluster tree to a smaller tree either by pruning until a given number of observation groups remain, or by pruning tree splits below a given height.

Usage

  prune.clust (cluster, k=NULL, h=NULL)

Arguments

cluster object of class "hclust" or "twins".
k desired number of groups.
h height at which to prune for grouping.


At least one of k or h must be specified; k takes precedence if both are given.

Details

Used with draw.clust. See example.

Value

Pruned cluster object of class "hclust".

Author(s)

Denis White, white.denis@epa.gov

See Also

hclust, twins.object, cutree, draw.clust

Examples

  library (mva)
  data (hex.spp)

  draw.clust (prune.clust (hclust (dist (hex.spp)), k=6))