Displaying 3 results from an estimated 3 matches for "distobject".
Did you mean:
listobject
2016 Apr 21
2
"cophenetic" function for objects of class "dendrogram"
Hello,
I have been using the "cophenetic" function for objects of class "dendrogram" and I have realised that it gives different results when it is used with objects of class "hclust". For instance, running the first example in the help file of the "cophenetic" function,
d1 <- dist(USArrests)
hc <- hclust(d1, "ave")
d2 <-
2016 Apr 21
1
"cophenetic" function for objects of class "dendrogram"
...n Thu, Apr 21, 2016 at 7:59 AM, William Dunlap <wdunlap at tibco.com> wrote:
> 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 2...
2016 Apr 21
0
"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 a...