Learn R Programming

evobiR (version 1.1)

ReorderData: Reorders trait data to match the order of tips in a tree

Description

This function takes a vector, matrix, or dataframe and reorders the data to match the order of tips in a phylo object.

Usage

ReorderData(tree, data, taxa.names="row names")

Arguments

tree
a phylo object
data
a vector, matrix, dataframe set of taxa names as present in the tree and data must match. If data is a vector it should be a named vector. If the data is a matrix or dataframe the taxa names may be row names or present in a column.
taxa.names
If taxa names are present in a column the column number should be supplied. If taxa names are the row names the argument can be set to "row names" (default setting). If the data is being supplied in a vector this argument is not used.

Details

Returns data in the same format as supplied but reordered to match the order of tip labels.

References

http://coleoguy.github.io/