Learn R Programming

spider (version 1.5.1)

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)

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

Arguments

phy

A tree of class `phylo'.

labels

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

Author

Samuel Brown <s_d_j_brown@hotmail.com>

Examples

Run this code

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