Conducts a statistical test of cospeciation between two trees
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 between trees!
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, ...)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. |
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.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
## 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)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.