Re: [R] Convert filogenetic tree to binary matrix

From: vanderlei52 <vanderleidebastianimach_at_yahoo.com.br>
Date: Fri, 29 Apr 2011 11:57:01 -0700 (PDT)

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.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 29 Apr 2011 - 19:27:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 29 Apr 2011 - 21:50:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive