[R] cut.dendrogram and cutree

Agustin Lobo Agustin.Lobo at ija.csic.es
Fri Oct 26 11:40:09 CEST 2007


Hi!

In the example:
hc <- hclust(dist(USArrests), "ave")
dend1 <- as.dendrogram(hc)
dend2 <- cut(dend1, h=70)

Do the branches "Branch 1", "Branch 2", "Branch 2"...in dend2$upper

  str(dend2$upper)
--[dendrogram w/ 2 branches and 4 members at h = 152]
   |--[dendrogram w/ 2 branches and 2 members at h = 77.6]
   |  |--leaf "Branch 1" (h= 38.5 midpoint = 0.5, x.member = 2 )
   |  `--leaf "Branch 2" (h= 44.3 midpoint = 5.03, x.member = 14 )
   `--[dendrogram w/ 2 branches and 2 members at h = 89.2]
      |--leaf "Branch 3" (h= 44.8 midpoint = 6.8, x.member = 14 )
      `--leaf "Branch 4" (h= 54.7 midpoint = 7.65, x.member = 20 )

correspond to the classes 1, 2, 3... in dendclass, where

dendclas <- cutree(hc,h=70)

?

If they do not, how can I get a vector with the original individuals
for each branch?

Thanks

Agus

-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es
http://www.ija.csic.es/gt/obster



More information about the R-help mailing list