Hello everybody,

I need to know how often every element in an hierarchical cluster was "branched" - just imagine a watering pot on the top of the hierarchical tree -> the leafs should get water according to the number of branches that lie before them.

For example:
a <- list()  # initialize empty object
a$merge <- matrix(c(-1, -2,
                    -3, -4,
                     1,  2,
                     -5,-6,
                     3,4), nc=2, byrow=TRUE )
a$height <- c(1, 2, 3,4,5)
a$order <- c(1,2,3,4,5,6)
a$labels <- 1:6
class(a) <- "hclust"
plot(a)

The leaf "1" has was branched three times -> it would get 1/2^3 = 0.125 of the "total water". Same for leaf 2.Leafs 3 and 4 would each get the same (0.125). Leaf 5 and 6 would get 0.25 -> Adding up to 1.
Does anybody have a clue?
Thanks a lot in advance!
Lui

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to