Learn R Programming

metricTester (version 1.3.6)

simulateComm: Generate a simulated community data matrix

Description

Given a phylo object, a vector of desired species richnesses, and a vector of potential species abundances, will generate a community data matrix with these characteristics.

Usage

simulateComm(tree, richness.vector, abundances)

Arguments

tree

Phylo object

richness.vector

Vector of desired species richness, one for each desired plot

abundances

A vector of potential abundances, e.g. a log-normal distribution

Value

A community data matrix (as a data frame) with species as columns and sites as rows.

Details

There is currently no implementation to control the frequency with which a given species is selected. As of metricTester 1.2.2, this function no longer can occasionally return a CDM missing species that are in the input phylogeny.

References

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

Examples

Run this code
# NOT RUN {
#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)
# }

Run the code above in your browser using DataLab