[R] Cannot convert from phylo to hclust , error!!???
david v
danova_fr at hotmail.com
Tue Jan 17 18:56:22 CET 2006
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
More information about the R-help
mailing list