Learn R Programming

RRphylo (version 3.0.0)

phyloclust: Test for phylogenetic clustering

Description

The function tests the presence of phylogenetic clustering for species within a focal state.

Usage

phyloclust(tree,state,focal,nsim=100)

Value

The function returns a list including the p-value ($p) for the test of phylogenetic clustering and a $declusterized object containing the declusterized versions of the original tree and state vector (i.e. tips are removed as to make p>0.05) and the vector of removed species.

Arguments

tree

a phylogenetic tree. The tree needs not to be ultrametric or fully dichotomous.

state

the named vector of tip states.

focal

the focal state to be tested for phylogenetic clustering.

nsim

number of simulations to perform the phylogenetic clustering test.

Author

Silvia Castiglione, Pasquale Raia

Details

To test for phylogenetic clustering, the function computes the mean cophenetic (i.e. evolutionary time) distance between all the species under the focal state. Such value is compared to a random distribution of time distances obtained by sampling nsim times as many random tips as those under the focal state. In the presence of significant phylogenetic clustering, tips under the focal state are randomly removed until the p becomes >0.05 or only 3 tips are left.

Examples

Run this code
data("DataFelids")
DataFelids$treefel->treefel
DataFelids$statefel->statefel

phyloclust(tree=treefel,state=statefel,focal="saber")->pcl

Run the code above in your browser using DataLab