| match_to_tree {abdiv} | R Documentation |
Match vector of counts to phylogenetic tree
Description
Match vector of counts to phylogenetic tree
Usage
match_to_tree(x, tree, x_labels = NULL)
Arguments
x |
A vector of species counts. |
tree |
A phylogenetic tree of class |
x_labels |
A vector of species labels for |
Details
This function applies a couple of different methods to arrange the
data in x to match a phylogenetic tree.
If
x_labelsis provided, we use this vector to match the elements ofxwith the tip labels in the tree.If
x_labelsis not provided andxis a named vector, we use the names to match the tip labels in the tree.If
x_labelsis not provided andxis not named, we assume thatxis already in the correct order, check that the length ofxmatches the number of tips in the tree, and returnx.
Value
The vector x, re-arranged to match the tree.
[Package abdiv version 0.2.0 Index]