[R] Convert filogenetic tree to binary matrix

From: vanderlei52 <vanderleidebastianimach_at_yahoo.com.br>
Date: Wed, 27 Apr 2011 10:55:14 -0700 (PDT)


I need to create a binary matrix with all node of a phylogenetic tree and the presence of each taxo in their respective node.

Example:

require(ape)
y<-read.tree(text="(E,((H,I)D,(F,G)C)B)A;") y
plot(y, show.node=TRUE)

I need to create a binary matrix as follows:

	A	B	C	D
G	1	1	1	0
F	1	1	1	0
I	1	1	0	1
H	1	1	0	1
E	1	0	0	0

Somebody could help me to solve this problem.

Thanks,

Vanderlei Debastiani

--
View this message in context: http://r.789695.n4.nabble.com/Convert-filogenetic-tree-to-binary-matrix-tp3478961p3478961.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 Wed 27 Apr 2011 - 18:12:11 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 Thu 28 Apr 2011 - 15:00: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