is.binary.tree {ape} | R Documentation

## Test for Binary Tree

### Description

This function tests whether a phylogenetic tree is binary.

### Usage

    is.binary.tree(phy)

### Arguments

`phy` | an object of class `"phylo"`.

### Details

The test differs slightly whether the tree is rooted or not. An urooted tree is considered binary if all its nodes are of degree three (i.e., three edges connect to each node). A rooted tree is considered binary if all nodes (including the root node) have exactly two descendant nodes, so that they are of degree three expect the root which is of degree 2.

### Value

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

### Author(s)

Korbinian Strimmer

### See Also

`is.rooted`, `is.ultrametric`, `multi2di`

### Examples

    data("hivtree.newick") # example tree in NH format
    tree.hiv <- read.tree(text = hivtree.newick)
    is.binary.tree(tree.hiv)
    plot(tree.hiv)

[Package ape version 3.4 Index]