Community assembly simulation code for use in the R programming language.
Ecological Archives M080-013-S2.
File list (downloads)
Nathan J. B. Kraft and David D. Ackerly
Department of Integrative Biology
University of California, Berkeley
Berkeley, CA USA
Address for correspondence:
Biodiversity Research Centre
University of British Columbia
6270 University Boulevard
Vancouver, BC V6T 1Z4 Canada
A set of functions in the R programming language for simulating community assembly randomly (with or without weighting species by abundance), by trait-based competition, or by trait-based habitat filtering. The linked text file contains a series of R functions, a brief demonstration of the functions, commentary on the algorithms, and references. There are three key functions, described below, and a series of smaller functions that support them. More detailed descriptions can be found as in the file itself.random_assembly(pool, final_richness, abund=NULL)
Randomly samples final_richness number of species from a vector of species names given in pool. Sampling is occurence weighted if a vector of abundances is specified in the abund argument- default is no abundance weighting.
filter_until(nfinal, community, optima)
Takes a data frame community with species names in column 1 and traits in subsequent columns and runs a competition algorithm to cull the community unitl nfinal taxa remain. At each step, the algorithm identifies the most similar pair of species based on trait similarity and randomly removes one. Ties are broken randomly.
Takes a data frame community with species names in column 1 and traits in subsequent columns and runs a habitat filtering algorithm to cull the community unitl nfinal taxa remain. At each step, the algorithm identifies the species that is farthest from the trait optima and removes it. Ties are broken randomly. The community can have from 1 to many traits, but the optima vector must have the same number of elements as the number of traits in the community dataframe.
ESA Publications | Ecological Archives | Permissions | Citation | Contacts