cospeciation {phytools} | R Documentation |
Conducts a statistical test of cospeciation between two trees
Description
Test for cospeciation based on tree distance.
Usage
cospeciation(t1, t2, distance=c("RF","SPR"),
method=c("simulation","permutation"), assoc=NULL,
nsim=100, ...)
## S3 method for class 'cospeciation'
plot(x, ...)
## S3 method for class 'cospeciation'
print(x, ...)
Arguments
t1 |
object of class |
t2 |
object of class |
distance |
distance method to compare trees. |
method |
method to use (simulation of pure-birth trees, or permutation of tip labels on a fixed tree) to obtain a null distribution of tree distances via |
assoc |
matrix containing the tip labels in |
nsim |
number of simulations or permutations. |
x |
for |
... |
optional arguments. |
Details
This function conducts a test for cospeciation based on tree distance, applying a distance metric selected by the user.
Note that this method should be prone to be quite liberal as the null hypothesis is no similarity whatsoever between the two trees!
Value
An object of class "cospeciation"
, which includes the test-statistic, the null distribution, and a p-value for the test of the null hypothesis of no topological similarity between the two trees.
Author(s)
Liam Revell liam.revell@umb.edu
References
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
See Also
Examples
## load data from Lopez-Vaamonde et al. (2001)
data(wasp.trees)
data(wasp.data)
## test for cospeciation
wasp.cosp<-cospeciation(wasp.trees[[1]],wasp.trees[[2]],
assoc=wasp.data)
print(wasp.cosp)
plot(wasp.cosp)
title(main=paste("Simulated distribution of RF distances\n",
"between unassociated trees"),font.main=3)