tree.partition | R Documentation |
partition a tree.
tree.partition(tree,nspecies)
tree |
the tree node matrix |
nspecies |
the number of species |
The function returns a matrix. Each row represents a particular partition of the tree. The position of "1" in the matrix indicates the presence of the corresponding species in the partition. The last number at each row is the frequency of that partition. This function returns the partition matrix for only one tree.
Liang Liu
treestr<-"((((H:0.00402,C:0.00402):0.00304,G:0.00707):0.00929,O:0.01635):0.1,W:0.12);"
nodematrix<-read.tree.nodes(treestr)$nodes
tree.partition(nodematrix,5)
#
# [,1] [,2] [,3] [,4] [,5] [,6]
#[1,] 1 0 1 0 0 1
#[2,] 1 1 1 0 0 1
#[3,] 1 1 1 1 0 1
#
#The last number of each row is the frequency of the corresponding partition.
#For example, the frequency of the first partition (1 0 1 0 0) is 1.
#The first partition includes species 1 and 3
#as indicated by the position of 1 in the partition.
#Each row represens a partition and its frequency.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.