partition.tree: partition a tree

Description Usage Arguments Value Author(s) See Also Examples

Description

partition a tree.

Usage

1
partition.tree(tree,nspecies)

Arguments

tree

the tree node matrix

nspecies

the number of species

Value

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. For multiple trees, the partitions and their frequencies can be obtained by the function consense.

Author(s)

Liang Liu

See Also

consense

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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
partition.tree(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.

bomeara/phybase documentation built on May 12, 2019, 11:35 p.m.