Learn R Programming

TreeTools (version 1.0.0)

GenerateTree: Generate pectinate, balanced or random trees

Description

RandomTree(), PectinateTree(), BalancedTree() and StarTree() generate trees with the specified shapes and leaf labels.

Usage

RandomTree(tips, root = FALSE)

PectinateTree(tips)

BalancedTree(tips)

StarTree(tips)

Arguments

tips

An integer specifying the number of tips, or a character vector naming the tips, or any other object from which TipLabels() can extract leaf labels.

root

Character or integer specifying tip to use as root, if desired; or FALSE for an unrooted tree.

Value

Each function returns an unweighted binary tree of class phylo with the specified leaf labels. Trees are rooted unless root = FALSE.

RandomTree() returns a random topology, optionally rooting the tree on a given tip.

PectinateTree() returns a pectinate (caterpillar) tree.

BalancedTree() returns a balanced (symmetrical) tree.

StarTree() returns a completely unresolved (star) tree.

See Also

Other tree generation functions: NJTree(), SingleTaxonTree(), TreeNumber

Examples

Run this code
# NOT RUN {
RandomTree(LETTERS[1:10])

data('Lobo')
RandomTree(Lobo.phy)

plot(PectinateTree(LETTERS[1:10]))

plot(BalancedTree(LETTERS[1:10]))
plot(StarTree(LETTERS[1:10]))

# }

Run the code above in your browser using DataLab