cutree                  package:mva                  R Documentation

_C_u_t _a _t_r_e_e _i_n_t_o _g_r_o_u_p_s _o_f _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     Cuts a tree, e.g., as resulting from `hclust', into several groups
     either by specifying the desired number of groups or the cut
     height.

_U_s_a_g_e:

     cutree(tree, k=NULL, h=NULL)

_A_r_g_u_m_e_n_t_s:

    tree: a tree as produced by `hclust'

       k: An integer scalar or vector with the desired number of groups

       h: A numeric scalar or vector with heights where the tree should
          be cut.

     At least one of `k' or `h' must be specified, `k' overrides `h' if
     both are given.

_V_a_l_u_e:

     `cutree' returns a vector with group memberships if `k' or `h' are
     scalar, otherwise a matrix with group meberships is returned where
     each column corresponds to the elements of `k' or `h',
     respectively (which are also used as column names).

_S_e_e _A_l_s_o:

     `hclust'

_E_x_a_m_p_l_e_s:

     require(mva)
     data(USArrests)

     hc <- hclust(dist(USArrests))

     cutree(hc, k=2:5)
     cutree(hc, h=250)

