tree.comp {spider} | R Documentation |
Tree comparisons
Description
Compares the clades between two trees.
Usage
tree.comp(phy1, phy2, method = "prop")
Arguments
phy1 , phy2 |
Trees of class ‘phylo’ to compare. |
method |
One of the following options:
|
Details
This function is a modification of the dist.topo
function in
ape
to give similarity between the two trees as a proportion, and to
account for the unreliable resolution of deeper nodes that affect some
methods of tree construction (such as NJ).
It is important that the tip labels of the two trees are the same. If the tip labels are different between the two trees, the method will not recognise any similarity between them.
This function does not take into account differences in branch length. The
"score"
method in dist.topo
does this if desired.
Value
Numeric vector of length 1.
If method = "prop"
, the number returned is the proportion of nodes in
the first tree for which there is a node in the second that contains the
same tips. Higher number represents greater similarity. If it is 1, the
trees are identical. If 0, the trees have no similarity whatsoever.
When method = "shallow"
, only those nodes tipwards of the median node
depth are taken into account. This will not be useful for small trees, but
may be helpful with larger datasets.
"PH85"
is the Penny and Hendy (1985) distance. This measure is the
default of dist.topo
. In this measure, the smaller the number,
the closer the trees are. If the trees are identical, this results in 0.
Author(s)
Samuel Brown <s_d_j_brown@hotmail.com>
References
Penny, D. and Hendy, M. D. (1985) The use of tree comparison metrics. _Systematic Zoology_ *34* 75-82.
See Also
Examples
set.seed(15)
tr <- ape::rtree(15)
set.seed(22)
tr2 <- ape::rtree(15)
tree.comp(tr, tr2)
tree.comp(tr, tr2, method="PH85")
tree.comp(tr, tr2, method="shallow")