subtree.length: Calculate total branch length of a tree

Description Usage Arguments Details Value Author(s) See Also Examples

Description

calculate the total branch length of a sub-tree under inode.

Usage

1
subtree.length(inode, nodes, nspecies)

Arguments

inode

the root node of the sub-tree

nodes

the tree node matrix

nspecies

the number of species in the tree

Details

The node matrix is the output of the function read.unrooted.nodes or read.rooted.nodes. The function can calculate the total branch length of a tree if inode is set to be the root node. If inode is not the root node, subtree.length calculates the total branch length of a sub-tree.

Value

The function returns the total branch length of a sub-tree.

Author(s)

Liang Liu lliu@uga.edu

See Also

node.height

Examples

1
2
3
tree.string<-"(((H:4.2,C:4.2):3.1,G:7.3):6.3,O:13.5);"
nodes<-read.tree.nodes(tree.string)$nodes
subtree.length(6,nodes,4)

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