ape (version 1.0)

is.binary.tree: Test for Binary Tree

Description

This function tests whether a phylogenetic tree is binary.

Usage

is.binary.tree(tree)

Arguments

tree
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.

See Also

read.tree, is.ultrametric

Examples

Run this code
library(ape)
data("hivtree.newick") # example tree
cat(hivtree.newick, file = "hivtree.phy", sep = "") # generate file "hivtree.phy"

tree.hiv <- read.tree("hivtree.phy")
is.binary.tree(tree.hiv)

plot(tree.hiv)

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

Run the code above in your browser using DataCamp Workspace