Cannot convert from phylo to hclust , error!!???

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Cannot convert from phylo to hclust , error!!???

david v-2
Hello,
The following code does'nt work for me. The last command reports an error. I
have created a consensus tree using the consensus comand from phylo but
cannot manipulate the phylo object afterwards to create a dendogram , by
transforming the phylo object into a hclust object and then into a dendogram
??
Thanks for any help

library(ade4)
library(cluster)
library(stats)
library(ape)

data<-read.table(file="in.matrix",header=FALSE,sep="\t",row.names=1)
dis<-dist.binary(data,method=5,diag=TRUE)
clust<-hclust(dis)
tree1<-as.phylo(clust)
tree2<-as.phylo(clust)
tree3<-as.phylo(clust)
tree4<-as.phylo(clust)
tree5<-as.phylo(clust)
liste <-list(tree1,tree2,tree3,tree4,tree5)
cons<-consensus(liste,p=0.5)
cons_clust <-as.hclust(cons)
Error in "[<-"(`*tmp*`, i, value = numeric(0)) :
        nothing to replace

david

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html