1

The following R code produces hierarchical cluster via multiscale bootstrap resampling in the Boston dataset.

library(pvclust)
library(MASS)
data(Boston)
boston.pv <- pvclust(Boston)
boston.pp <- pvrect(boston.pv)
clusters <- pvpick(boston.pv)

enter image description here

Finally, clusters$clusters lists the elements from significant clusters:

$clusters[[1]]
[1] "crim" "indus" "nox" "age" "rad" "tax"    
[7] "ptratio" "lstat"  

$clusters[[2]]
[1] "zn" "rm" "dis" "black" "medv" 

Is there a way to extract these same items without throwing way their hierarchy? For example keeping their edge order, like:

 $clusters[[1]]
[1] "rad" "tax" "indux" "nox" "age" "lstat"    
[7] "crim" "pratio"  

$clusters[[2]]
[1] "rm" "medv" "zn" "dis" "black" 

Or something similar? Thanks in advance.

tbrittoborges
  • 965
  • 1
  • 6
  • 16
  • Ideally, I would use something like: given the edge i, give all sets of relationships down to the cluster leafs. – tbrittoborges Mar 19 '15 at 00:04
  • If I may ask - do you want to get a significant subtree? (May I ask why?) – Tal Galili Apr 24 '15 at 20:58
  • Yes, it would be good. And I need to process the sub-clusters' elements and the order of processing is important, I mean, treewise processing instead of pairwise. – tbrittoborges Apr 27 '15 at 14:07
  • What you could do is use the `prune` function from the {dendextend} package. So you could get the list of labels for signif subtrees, and prune the original tree to these trees (pruning is best done with that function, since it involves several steps to get a valid tree). Would that solve your issue? – Tal Galili Apr 27 '15 at 17:56

0 Answers0