Skip to contents

Returns a named vector of integer abundances for n_species that sums to n_individuals.

Usage

generate_sad(n_species, n_individuals, model = "fisher", sad = NULL, ...)

Arguments

n_species

Integer (>= 1). Number of species.

n_individuals

Integer (>= 0). Number of individuals.

model

Character scalar. One of the models described under “Models” in ?sad_generators.

sad

For model = "custom": either a numeric vector (probabilities or counts) or a function function(n_species, n_individuals, ...) returning a numeric vector.

...

Model-specific parameters. Common arguments include: k (geometric), exponent and q (Zipf / Mandelbrot), meanlog, sdlog (lognormal), shape, rate (Poisson–gamma), and neutral-theory theta, m.

For model = "fisher", pass dominant_fraction, alpha, and x (see generate_fisher_log_series()).

Value

A named integer vector of length n_species (some entries may be 0) whose names are LETTERS[1:n_species].