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)

