Learn R Programming

convevol (version 2.2.1)

allmaxdist: Calculates maxdist for all pairs of taxa in a phylogeny.

Description

allmaxdist Uses maxdist to calcualte the maximum phenotypic. distance between the ancestors of all pairs of taxa in a phylogeny. By default outputs these as a matrix, but can also output a list. Can take some time to run for large trees.

Usage

allmaxdist(phyl, phendata, mat = TRUE)

Value

A matrix or list of all maxdist values for all pairs of taxa in the phylogeny.

Arguments

phyl

The phylogeny of interest in phylo format

phendata

Phenotypic data for all tips

mat

Whether or not to export the values in a matrix (default) or a list

Details

Regarding the output: the matrix is better organized, but the list avoids all the zeroes and is probably better for making histograms.

References

Paradis, E., J. Claude, and K. Strimmer (2004) APE: Analyses of phylogenetics and evolution in R langauge. Bioinformatics, 20, 289-290.

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol. 3 217-223.

Examples

Run this code

phyl<-rtree(10)
phendata<-fastBM(phyl,nsim=2)
answer<-allmaxdist(phyl,phendata,mat=TRUE)

Run the code above in your browser using DataLab