Learn R Programming

metricTester (version 1.3.6)

abundanceVector: Generate regional abundance vector

Description

Given a community data matrix of sites by species, extract the column-wise sums (the total number of individuals of each species) and expand to create a regional abundance vector.

Usage

abundanceVector(picante.cdm)

Arguments

picante.cdm

Community data matrix in picante format

Value

A character vector in the form "s1, s1, s1, s2, s2, s3, etc".

Details

Simple function to create a regional abundance vector given a "regional" community data matrix.

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)

abund <- abundanceVector(cdm)
# }

Run the code above in your browser using DataLab