nodeDist {windex}R Documentation

Plotting and/or retrieving distribution of divergence times of a pair of species from a set of phylogenetic trees.

Description

Plots and/or retrieves the distribution of age estimates of the most recent common ancestor of a specified pair of species across trees (for instance a posterior distribution).

Usage

nodeDist(trees,sp1,sp2,relTime=F,fillcol="blue",xlabel="Age (mya)",main="",
return.ages=F,plot=T,add=F,...)

Arguments

trees

An object of class multiPhylo containing a set of time-calibrated trees.

sp1

Name of one of the two species for which the divergence time is of interest.

sp2

Name of the other of the two species for which the divergence time is of interest.

relTime

Logical whether to plot relative (to age of root) divergence times or absolute times (defaults to absolute times).

fillcol

Colour to plot distribution.

xlabel

Label for the x-axis.

main

Title for plot (if desired, defaults to no title).

return.ages

Logical whether to return a vector of the relative (to age of root) divergence times or absolute times (defaults to FALSE, i.e. only plotting the distribution).

plot

Logical whether to plot distribution of divergence times, either absolute or relative as controlled by relTime argument (defaults to TRUE).

add

Logical whether to overlay distribution on an existing plot (make sure xlim and ylim on original call are set to accomodate both distributions).

...

Additional arguments to customise output, passed to plot.

Value

Density plot of the distribution of relative or absolute divergence times across trees for the specified pair of species, and/or a vector of those divergence times.

Author(s)

Kevin Arbuckle

Examples

## Not run: 
# Density plot of absolute divergence times
nodeDist(trees,"Naja_haje","Naja_nivea")

# Density plot of relative divergence times (root age for each tree set to 1)
nodeDist(trees,"Naja_haje","Naja_nivea",relTime=T,xlabel="Relative time")
## End(Not run)

[Package windex version 2.0.8 Index]