Skip to content

is there a way of getting a sub-agnes.object from a big tree?

2 messages · Zhijin (Jean) Wu, Martin Maechler

#
Hello masters
  For example if I see two big branches of the agnes tree, I can use
prune.clust (original.tree,k=2) or "cutree" to cut it into 2. For each
subset of data if I use agnes again it will look the same as a branch of
the original tree. But is there an easier way to retrieve a "sub
agnes.object" since the original tree was grown agglomeratively?
  Thanks a bunch!
Jean


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
2 days later
#
Jean> Hello masters For example if I see two big branches of
    Jean> the agnes tree, I can use prune.clust
    Jean> (original.tree,k=2) or "cutree" to cut it into 2. For
    Jean> each subset of data if I use agnes again it will look
    Jean> the same as a branch of the original tree. But is
    Jean> there an easier way to retrieve a "sub agnes.object"
    Jean> since the original tree was grown agglomeratively?

One way is to use  dendrograms :

  dt <- as.dendrogram(original.tree)
  mcut <- cut(dt, h = .....)

and then mcut is a list containing the sub-dendrograms.
Use
	library(mva)
	help(as.dendrogram)
to see more, including an example.

Note that R-devel (to be 1.6 in fall) contains a bit better code
& functionality for dendrograms.

    Jean> Thanks a bunch!
your welcome.

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._