Take a finite sample of individuals without replacement from an integer abundance vector.

sample_finite(ab, size = sum(ab))

Arguments

ab

A numeric vector of species abundances or relative abundances.

size

Number of individuals to sample, defaults to all of them, a scalar

Value

A numeric vector of species abundances, including 0's

See also

Examples

sample_finite(1:9, 15)
#> [1] 1 1 2 2 0 3 1 2 3