is.binary.tree: Test for Binary Tree

Description Usage Arguments Value Author(s) See Also Examples

Description

This function tests whether a phylogenetic tree is binary, i.e. whether every node (including the root node) has exactly two descendant nodes. In this case the number of edges in the tree equals 2 n - 2 where n is the number of taxa (tips) in the tree.

Usage

1

Arguments

phy

phylogenetic tree (i.e. an object of class "phylo").

Value

is.binary.tree returns TRUE if tree is a fully binary phylogenetic tree, otherwise it returns FALSE.

Author(s)

Korbinian Strimmer (http://www.stat.uni-muenchen.de/~strimmer/)

See Also

read.tree, is.ultrametric, multi2di

Examples

1
2
3
4
5
6
7
8
data("hivtree.newick") # example tree in NH format
tree.hiv <- read.tree(text = hivtree.newick) # load tree

is.binary.tree(tree.hiv)

plot(tree.hiv)

unlink("hivtree.phy") # delete the file "hivtree.phy"

gjuggler/ape documentation built on May 17, 2019, 6:03 a.m.