reorder                 package:mva                 R Documentation

_R_e_o_r_d_e_r _a _d_e_n_d_r_o_g_r_a_m

_D_e_s_c_r_i_p_t_i_o_n:

     There are many different orderings of a dendrogram that are
     consistent with the structure imposed.  This function takes a
     dendrogram and a vector of values and reorders the dendrogram in
     the order of the supplied vector, maintaining the constraints on
     the dendrogram.

_U_s_a_g_e:

     reorder(x, ...)

     ## S3 method for class 'dendrogram':
     reorder(x, wts, ...)

_A_r_g_u_m_e_n_t_s:

       x: The object to be reordered

     wts: The weights for reordering.

     ...: additional arguments 

_D_e_t_a_i_l_s:

     Using the weights the leaves of the dendrogram are reordered so as
     to be in an order as consistent as possible with the weights.

_V_a_l_u_e:

     From 'reorder.dendrogram' a dendrogram.

_A_u_t_h_o_r(_s):

     R. Gentleman

_S_e_e _A_l_s_o:

     'heatmap', 'cophenetic'

_E_x_a_m_p_l_e_s:

       set.seed(123)
       x <- rnorm(10)
       hc <- hclust(dist(x))
       dd <- as.dendrogram(hc)
       dd.reorder <- reorder(dd, 10:1)

       op <- par(mfcol = 1:2)
       plot(dd, main = "random dendrogram `dd'")
       plot(dd.reorder, main = "reorder(dd, 10:1)")
       par(op)

