Hello Dear R developers.

In using R 3.0.1 on Windows 7 (tried on two computers), I encountered the
following behavior:


###################################
###################################
# get a dendrogram:
data(iris)
d_iris <- dist(iris[1:4,-5])
hc_iris <- hclust(d_iris)
dend_iris <- as.dendrogram(hc_iris) # as.hclust.dendrogram - of course

# taking a subset of the dendrogram:
sub_dend_iris <- dend_iris[[2]]
hc_sub_dend_iris <- as.hclust(sub_dend_iris)

## from now on, this object: "hc_sub_dend_iris" is dangerous

dend_hc_sub_dend_iris <- as.dendrogram(hc_sub_dend_iris)
labels(dend_hc_sub_dend_iris) # labels are filled with NA's
#  "3" "4" NA

order.dendrogram(dend_hc_sub_dend_iris) # this is probably the source of
the problem
#  2 3 4


# running the next line (sometimes once, sometimes it takes 5 times running
the same line) causes my R to crash:
# cutree(hc_sub_dend_iris,3)
###################################
###################################

I suspect the problem is because of the way as.hclust.dendrogram is using
the "order" in the dendrogram leaves, combined with the C code in hclust.



With regards,
Tal


----------------Contact
Details:-------------------------------------------------------
Contact me: tal.gal...@gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English) | www.r-bloggers.com (English)
----------------------------------------------------------------------------------------------

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to