]> git.donarmstrong.com Git - ape.git/blob - man/is.binary.tree.Rd
various bug fixes
[ape.git] / man / is.binary.tree.Rd
1 \name{is.binary.tree}
2 \alias{is.binary.tree}
3 \title{Test for Binary Tree}
4 \usage{
5 is.binary.tree(phy)
6 }
7 \arguments{
8   \item{phy}{phylogenetic tree (i.e. an object of class \code{"phylo"}).}
9 }
10 \description{
11  This function tests whether a phylogenetic tree is binary, i.e. whether every node
12  (including the root node) has exactly two descendant nodes.  In this case the number
13  of edges in the tree equals 2 n - 2 where n is the number of taxa (tips) in the tree.
14 }
15 \value{
16   \code{is.binary.tree} returns \code{TRUE} if \code{tree}
17    is a fully binary phylogenetic tree, otherwise it returns \code{FALSE}.
18 }
19 \seealso{
20 \code{\link{read.tree}}, \code{\link{is.ultrametric}}, \code{\link{multi2di}}
21 }
22
23 \author{Korbinian Strimmer (\url{http://www.stat.uni-muenchen.de/~strimmer/})}
24
25 \examples{
26 data("hivtree.newick") # example tree in NH format
27 tree.hiv <- read.tree(text = hivtree.newick) # load tree
28
29 is.binary.tree(tree.hiv)
30
31 plot(tree.hiv)
32
33 unlink("hivtree.phy") # delete the file "hivtree.phy"
34 }
35 \keyword{logic}