spider (version 1.5.0)

tiporder: Orders tip labels by their position on the tree.

Description

Provides an ordered vector of tip labels, corresponding to their position on the tree.

Usage

tiporder(phy, labels = TRUE)

Arguments

phy

A tree of class `phylo'.

labels

Logical. Should labels be printed? If FALSE, the indices are given. Default of TRUE.

Value

A character or numeric vector giving the names of the tip in the order of their position on the tree. The order is that from top to bottom when the tree is plotted with direction = "rightwards".

Examples

Run this code
# NOT RUN {
data(anoteropsis)
anoTree <- ape::nj(ape::dist.dna(anoteropsis))
tiporder(anoTree)
tiporder(anoTree, labels = FALSE)


data(woodmouse)
woodTree <- ape::nj(ape::dist.dna(woodmouse))
tiporder(woodTree)
tiporder(ape::ladderize(woodTree))

# }

Run the code above in your browser using DataLab