phyloclust: Test for phylogenetic clustering

View source: R/phyloclust.R

phyloclustR Documentation

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)

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.

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.

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.

Author(s)

Silvia Castiglione, Pasquale Raia

Examples

data("DataFelids")
DataFelids$treefel->treefel
DataFelids$statefel->statefel

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

RRphylo documentation built on June 7, 2023, 5:49 p.m.