Learn R Programming

paleotree (version 1.0)

multiDiv: Calculating Diversity Curves Across Multiple Datasets

Description

Given a list of data, such as taxic range and phylogenetic trees, diversity curves are calculated for the same intervals across all the individual datasets. A median curve with 95 percent quantile bounds can be calculated and plotted.

Usage

multiDiv(data, int.length = 1, plot = T, output=F, drop.ZLB=T)
plotMultiDiv(results)

Arguments

data
A list where each element is a dataset formatted to be input in one of the diversity curve functions in this package
int.length
Time interval length
plot
Should the median diversity curve be plotted
output
Should the median diversity curve be output?
drop.ZLB
Should terminal zero-length branches be dropped on phylogenetic datasets?
results
The output of a previous run of multiDiv

Value

  • A list composed of three elements:
  • int.timesA two column matrix giving interval start and end times
  • divA matrix of measured diversities in particular intervals by rows, with each column representing a different dataset included in the input
  • median.curveA three column matrix, where the first column is the calculated median curve and the second and third columns are the 95 percent quantile upper and lower bounds

Details

This function is essentially a wrapper for the individual diversity curve functions in this package. It will intuitively decide whether datasets it is given are continuous-time taxic ranges, discrete-time (binned interval) taxic ranges or phylogenetic trees, as long as they are formatted as the individual functions request. A list that contains a mix of data types is entirely acceptable. As with many functions in the paleotree library, absolute time is always decreasing, i.e. the present day is zero. The 'averaged' curve is actually the median rather than the mean as diversity counts are often highly skewed (in my experience). The shaded certainty region around the median curve is the two-tailed 95 percent lower and upper quantiles, calculated from the observed data. It is not a true confidence interval, as it has no relaitonship to the standard error.

See Also

The diversity curve functions used: phyloDiv,taxicDivCont,taxicDivDisc, Also see the function LTT.average.root() in the package TreeSim, which calculates an average LTT curve for multiple phylogenies.

Examples

Run this code
set.seed(444)
taxa<-simFossilTaxa(p=0.1,q=0.1,nruns=1,mintaxa=20,maxtaxa=30,maxtime=1000,nExtant=0)
rangesCont<-sampleRanges(taxa,r=0.5)
rangesDisc<-binTimeData(rangesCont,int.length=1)
cladogram<-taxa2cladogram(taxa,plot=TRUE)
#using multiDiv with very different data types
ttree<-timePaleoPhy(cladogram,rangesCont,type="basic",add.term=TRUE,plot=FALSE)
multiDiv(list(rangesCont,rangesDisc,ttree),plot=TRUE,output=FALSE)
#using multiDiv with samples of trees
ttrees<-timePaleoPhy(cladogram,rangesCont,type="basic",ntrees=10,add.term=TRUE,plot=FALSE)
multiDiv(ttrees)

Run the code above in your browser using DataLab