reorder.hclust             package:gclus             R Documentation

_R_e_o_r_d_e_r_s _o_b_j_e_c_t _o_r_d_e_r _o_f _h_c_l_u_s_t, _k_e_e_p_i_n_g _o_b_j_e_c_t_s _w_i_t_h_i_n _a _c_l_u_s_t_e_r
_c_o_n_t_i_g_u_o_u_s _t_o _e_a_c_h _o_t_h_e_r.

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

     Reorders objects so that  nearby object pairs are adjacent.

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

     reorder.hclust(x,dis,...)

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

       x: is the result of 'hclust'.

     dis: is a distance matrix or 'dist'.

     ...: additional arguments.

_D_e_t_a_i_l_s:

     In hierarchical cluster displays, a decision is needed at  each
     merge to specify which subtree should go on the left  and which on
     the right.  This algorithm uses the order suggested by Gruvaeus
     and Wainer (1972). At a merge of clusters A and B, the new cluster
     is one of (A,B), (A',B), (A,B'),(A',B'), where A' denotes A in
     reverse order. The new cluster is chosen to minimize the distance
     between the object in A placed adjacent to an object from B.

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

     A permutation of the objects represented by 'dis' is returned.

_A_u_t_h_o_r(_s):

     Catherine B. Hurley

_R_e_f_e_r_e_n_c_e_s:

     Hurley, Catherine B.  "Clustering Visualisations of
     Multidimensional  Data", Journal of Computational and Graphical
     Statistics, vol. 13, (4), pp 788-806, 2004.

     Gruvaeus, G. and Wainer, H. (1972), "Two Additions to Hierarchical
     Cluster Analysis", British Journal of Mathematical and Statistical
     Psychology, 25, 200-206.

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

     'hclust',  'order.hclust' .

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

     data(eurodist)
     dis <- as.dist(eurodist)
     hc <- hclust(dis, "ave")

     layout(matrix(1:2,nrow=2,ncol=1))
     op <- par(mar=c(1,1,1,1))
     plot(hc)
     hc1 <- reorder.hclust(hc, dis)
     plot(hc1)
     par(op)
     layout(matrix(1,1))

     # Both dedrograms correspond to the same tree structure,
     # but the second one shows that
     # Paris is closer to Cherbourg than Munich, and
     # Rome is closer to Gibralter than to Barcelona.

     # We can also compare both orderings with an
     # image plot of the colors.
     # The second ordering seems to place nearby cities
     # closer to each other.

     layout(matrix(1:2,nrow=2,ncol=1))
     op <- par(mar=c(1,6,1,1))
     cmat <- dmat.color(eurodist, rev(cm.colors(5)))
     plotcolors(cmat[hc$order,hc$order], rlabels=labels(eurodist)[hc$order])

     plotcolors(cmat[hc1$order,hc1$order], rlabels=labels(eurodist)[hc1$order])

     layout(matrix(1,1))
     par(op)

