BAT (version 2.9.6)

sim.sad: Simulation of species abundance distributions (SAD).

Description

Creates artificial communities following given SADs.

Usage

sim.sad(n, s, sad = "lognormal", sd = 1)

Value

A matrix of species x abundance per species.

Arguments

n

total number of individuals.

s

number of species.

sad

The SAD distribution type (lognormal, uniform, broken stick or geometric). Default is lognormal.

sd

The standard deviation of lognormal distributions. Default is 1.

Details

Species Abundance Distributions may take a number of forms. A lognormal SAD probably is the most supported by empirical data, but we include other common types useful for testing multiple algorithms including several of the functions in BAT.

Examples

Run this code
comm1 <- sim.sad(10000, 100)
comm2 <- sim.sad(10000, 100, sd = 2)
comm3 <- sim.sad(10000, 100, sad = "uniform")
par(mfrow=c(1,3))
hist(log(comm1$Freq))
hist(log(comm2$Freq))
hist(log(comm3$Freq))

Run the code above in your browser using DataLab