하나는,752을 사용할 수 있습니다package
drop.tip
에 's의 :
require(ape)
require(dendextend)
require(data.tree)
dend <- iris[1:5,-5] %>% dist %>% hclust %>% as.dendrogram
tol.level <- 0.28
dend %>% plot(horiz = TRUE); abline(v=tol.level,col="red",lty=2)

그래서 우리의 허용 수준은 0.28이고, 그들의 조상 노드의 깊이가 tol.level
#convert dendrogram to data.tree
dend.dt <- as.Node(dend)
#get vector of leaves per each internal node
node.list <- lapply(dend.dt$Get(function(node) node$leaves,filterFun = isNotLeaf),function(n) unname(sapply(unlist(n,recursive = T),function(l) l$name)))
#get vector of per each internal node
node.depth.df <- data.frame(depth=c(t(sapply(Traverse(dend.dt,traversal="pre-order",pruneFun=isNotLeaf),function(x) c(x$plotHeight)))),stringsAsFactors=F)
to.drop.leave.names <- c(sapply(which(node.depth.df$depth < tol.level),function(i) node.list[[i]]))
#convert dendrogram to phylo
phylo.dend <- as.phylo(dend)
phylo.dend <- drop.tip(phylo.dend,tip=to.drop.leave.names,interactive=FALSE,trim.internal=FALSE)
plot(phylo.dend,use.edge.length=F)
아래에 있기 때문에 따라서 우리가, 잎
(1,5)
및
(3,4)
을 축소 할

이제 우리는 dendrogram
(Chronogram
)
new.dend <- chronos(phylo.dend)
출처
2017-01-31 00:00:00
dan
아주 좋은으로 다시 변환 할 수 있습니다. 공차 컷오프 수준에서 덴 드로 그램을 자르는 것은 정말로 불가능합니까? 하나의 잎이 많은 잎 그림이 있지만 의미있는 클러스터의 수가 훨씬 적 으면 (따라서 허용 한계는 매우 높을 것입니다) 컷 드레드 프로그램은 기본 '정글'보다 훨씬 쉽게 볼 수 있습니다 나뭇잎으로 내려가. – dan