Calculates the rate of accumulation of phylogenetic endemism (CpE) over time slices
Source:R/CpE.R
CpE.Rd
This function estimates the rates of accumulation of phylogenetic endemism (CpE) over time for inputted assemblages.
Arguments
- tree
phylo. An ultrametric phylogenetic tree in the "phylo" format.
- n
numeric. A numeric value indicating the number of temporal slices (method = 1) or the time interval in million years (or phylogenetic diversity) among the tree slices (method = 2). Default is 1.
- mat
matrix. A presence/absence matrix containing all studied species and sites.
- criterion
character string. The method for cutting the tree. It can be either "my" (million years) or "PD" (accumulated phylogenetic diversity). Default is "my".
- pEO
numeric. A value indicating the numeric proportion to define the temporal origin at which the phylogenetic endemism (PE) started to accumulate in a given assemblage. Default is 5%.
- ncor
numeric. A value indicating the number of cores the user wants to parallelize. Default is 0.
Value
The function returns a data frame containing the assemblages' rates of cumulative phylogenetic endemism (CpE), their total phylogenetic endemism (PE), and their PE origin (pEO).
Details
Parallelization
Users are advised to check the number of available cores within their machines before running parallel programming.
Author
Matheus Lima de Araujo matheusaraujolima@live.com
Examples
# Generate a random tree
tree <- ape::rcoal(20)
# Create a presence-absence matrix
mat <- matrix(sample(c(1,0), 20*10, replace = TRUE), ncol = 20, nrow = 10)
colnames(mat) <- tree$tip.label
# Calculate the CpE for 100 tree slices
CpE(tree, n = 100, mat = mat)
#> > The 100 number of pieces inputted equals to intervals of 0.0157672898514061 million of years.
#> CpE PE pEO
#> 1 1.463387 0.5012240 2.047123
#> 2 1.494041 0.5127746 2.005121
#> 3 1.457268 0.5002788 2.055718
#> 4 1.160264 0.3601296 2.581941
#> 5 1.159818 0.3867906 2.582934
#> 6 1.416015 0.4862453 2.115607
#> 7 1.463387 0.5012240 2.047123
#> 8 1.341757 0.4550217 2.232694
#> 9 1.433305 0.4914592 2.090087
#> 10 1.153609 0.3625643 2.596834