group.clust {maptree}R Documentation

Observation Groups for a Hierarchical Cluster Tree

Description

Alternative to cutree that orders pruned groups from left to right in draw order, and adds group membership of observations to pts matrix if provided.

Usage

  group.clust (cluster, k=NULL, h=NULL, pts=NULL)

Arguments

cluster object of class "hclust" or "twins".
k desired number of groups.
h height at which to prune for grouping.
pts vector, matrix, or data frame of length or nrow equal to length(cluster[["order"]]) to which group vector is joined with cbind.


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

Details

Normally used with map.groups. See example.

Value

Vector of pruned cluster membership or the cbind of pts and this vector if pts != NULL.

Author(s)

Denis White, white.denis@epa.gov

See Also

hclust, twins.object, cutree, map.groups

Examples

  library (mva)
  data (hex.spp, hex.env, oregon)

  map.groups (group.clust (hclust (dist (hex.spp)), k=6,
      pts=hex.env), lns=oregon)