Skip to content
Prev 51845 / 63424 Next

"cophenetic" function for objects of class "dendrogram"

I think the results differ only in the order of the labels.  The following
function
puts the labels in a standard order and then the results are the same:

  canonicalize.dist <- function (distObject)
  {
      o <- order(labels(distObject))
      as.matrix(distObject)[o, o, drop = FALSE]
  }
  identical(canonicalize.dist(d2), canonicalize.dist(d3))
  [1] TRUE




Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Thu, Apr 21, 2016 at 2:37 AM, Alberto Fern?ndez Sabater <
alberto.fernandez at urv.cat> wrote:

            

  
  
Message-ID: <CAF8bMcahx7fiNhmTjW7Qpnrgoi5UbXepBce8PYtRk_ms76upfw@mail.gmail.com>
In-Reply-To: <VI1PR01MB138950829C65980A4FF9CC01F56E0@VI1PR01MB1389.eurprd01.prod.exchangelabs.com>