Re: [R] Convert filogenetic tree to binary matrix

From: vanderlei52 <>
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:

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


View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
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 Please read the posting guide before posting to the list.

list of date sections of archive