TreeTools (version 0.1.3)

RootTree: Root a phylogenetic tree

Description

Roots a tree on the smallest clade containing the specified tips.

Usage

RootTree(tree, outgroupTips)

RootOnNode(tree, node, resolveRoot = FALSE)

Arguments

tree

A tree of class phylo.

outgroupTips

Character vector specifying the names of the tips to include in the outgroup.

node

integer specifying node (internal or tip) to set as the root.

resolveRoot

logical specifying whether to resolve the root node.

Value

RootTree returns a tree of class phylo, rooted on the smallest clade that contains the specified tips.

RootOnNode returns a tree of class phylo, rooted on the requested node and ordered in Preorder.

Functions

  • RootOnNode: Roots a tree on a specified internal node.

See Also

Examples

Run this code
# NOT RUN {
tree <- PectinateTree(8)
plot(tree)
ape::nodelabels()

plot(RootTree(tree, c('t6', 't7')))

plot(RootOnNode(tree, 12))
plot(RootOnNode(tree, 2))

# }

Run the code above in your browser using DataLab