Description Usage Arguments Details Value References Examples
Simple utility function to convert an absolute abundance matrix to a relative abundance matrix.
1 | relativeCDM(picante.cdm, tree = NULL)
|
picante.cdm |
Picante-style community data matrix with communities/plots/plots/etc as rows and species as columns |
tree |
Optional phylo object |
This function converts species' absolute abundances in a given community (a row in the input CDM) into relative abundances by dividing observed abundances by the maximum abundance in that row. If a tree is provided, the function confirms that the CDM is indeed in the correct format, otherwise it assumes it is formatted correctly and proceeds accordingly.
A relative abundance matrix otherwise identical to the input CDM.
Miller, E. T., D. R. Farine, and C. H. Trisos. 2016. Phylogenetic community structure metrics and null models: a review with new methods and software. Ecography DOI: 10.1111/ecog.02070
1 2 3 4 5 6 | #simulate tree with birth-death process
tree <- geiger::sim.bdtree(b=0.1, d=0, stop="taxa", n=50)
sim.abundances <- round(rlnorm(5000, meanlog=2, sdlog=1)) + 1
cdm <- simulateComm(tree, richness.vector=10:25, abundances=sim.abundances)
|
Loading required package: ape
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.