[R] Convert filogenetic tree to binary matrix

vanderlei52 vanderleidebastianimach at yahoo.com.br
Fri Apr 29 20:57:01 CEST 2011


Hi Ben,

Thank you for your help.

I did the same question in the r-sig-phylo mailing list. Liam Revell gave
the following solution: 

temp<-prop.part(tree)
X<-matrix(0,nrow=length(tree$tip),ncol=length(temp),dimnames=list(tree$tip.label,tree$node.label))
for(i in 1:ncol(X)) X[temp[[i]],i]<-1

Vanderlei


--
View this message in context: http://r.789695.n4.nabble.com/Convert-filogenetic-tree-to-binary-matrix-tp3478961p3484371.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list